Setting up NewRelic Monitoring on Ubuntu 12.4

NewRelic has become more and more popular over the years, and at the moment, they are offering a free T-Shirt and a donation of $10 to Movember for new account deployments. They do have instructions on their site, but I wanted to put my preferred method of installation and configuration somewhere central.

We start by adding a new apt sources list to our Ubuntu installation, which NewRelic have kindly made easier by creating a downloadable sources.list.d file, which you can get like so:

$ sudo wget -O /etc/apt/sources.list.d/newrelic.list http://download.newrelic.com/debian/newrelic.list

Next we need to fetch the correct keys from the key server:

$ sudo apt-key adv --keyserver hkp://subkeys.pgp.net --recv-keys 548C16BF

Now we have all that we need, we can update apt, and install the NewRelic System Monitoring Daemon:

$ sudo apt-get update
$ sudo apt-get install newrelic-sysmond

Now all that’s left to do is adding our license key and starting the service, which can be done using the following commands (substituting XXXXXXXXXX with your own license key):

$ sudo nrsysmond-config --set license_key=XXXXXXXXXX
$ sudo /etc/init.d/newrelic-sysmond start

Your server should now magically appear in your NewRelic account.

Simple Install Script

For convenience, I have created this process as a simple bash script, which you can download below. Simply run it as a privileged user with the license key as the parameter:

$ sudo ./install_newrelic_ubuntu-12.4.sh XXXXXXXXXX

Download Installer Script

Advertisements