How to: Install the NewRelic Server Monitoring agent on Ubuntu
How to: Install the NewRelic Server Monitoring agent on Ubuntu
NewRelic is a company that offer monitoring services for all your web applications. It has support for a wide variety of technologies, primarily does centered around web applications/sites. In order to install the NewRelic Server Monitoring agent on an Ubuntu box simply follow these instructions:
sudo bash echo deb http://apt.newrelic.com/debian/ newrelic non-free >> /etc/apt/sources.list.d/newrelic.list wget -O- https://download.newrelic.com/548C16BF.gpg | apt-key add – apt-get update apt-get install newrelic-sysmond nrsysmond-config –set license_key=YOUR.LICENSE.KEY.GOES.HERE nano /etc/newrelic/nrsysmond.cfg /etc/init.d/newrelic-sysmond start
I´ll walk you through the steps here:
- Start a super admin terminal session to avoid any issues with permissions (using sudo on everything is just tiresome)
- sudo bash
- Add the NewRelic distribution list to your system
-
- echo deb http://apt.newrelic.com/debian/ newrelic non-free >> /etc/apt/sources.list.d/newrelic.list
- Get the key for the distribution packages
-
- wget -O- https://download.newrelic.com/548C16BF.gpg | apt-key add –
- Update the list of available packages
- apt-get update
- Install the latest NewRelic system monitoring daemon
- apt-get install newrelic-sysmond
- Configure your server license so the information gets to your dashboards
- nrsysmond–config –set license_key=YOUR.LICENSE.KEY.GOES.HERE
- Configure your options. I particular like turning on SSL
- nano /etc/newrelic/nrsysmond.cfg
- ssl=true
- Start the NewRelic Server Monitor Agent daemon
- /etc/init.d/newrelic-sysmond start
- Enjoy!
Here is a sample of the /etc/newrelic/nrsysmond.cfg file with the descriptions so you can see if there is one you wish to modify:
## New Relic Server Monitor configuration file.## Lines that begin with a # are comment lines and are ignored by the server# monitor. For those options that have command line equivalents, if the# option is specified on the command line it will over-ride any value set# in this file.### Option : license_key# Value : 40-character hexadecimal string provided by New Relic. This is# required in order for the server monitor to start.# Default: none#license_key=HERE_GOES_YOUR_LICENSE_KEY## Option : loglevel# Value : Level of detail you want in the log file (as defined by the logfile# setting below. Valid values are (in increasing levels of verbosity):# error – show errors only# warning – show errors and warnings# info – show minimal additional information messages# verbose – show more detailed information messages# debug – show debug messages# verbosedebug – show very detailed debug messages# Default: error# Note : Can also be set with the -d command line option.#loglevel=info## Option : logfile# Value : Name of the file where the server monitor will store it’s log# messages. The amount of detail stored in this file is controlled# by the loglevel option (above).# Default: none. However it is highly recommended you set a value for this.# Note : Can also be set with the -l command line option.#logfile=/var/log/newrelic/nrsysmond.log## Option : proxy# Value : The name and optional login credentials of the proxy server to use# for all communication with the New Relic collector. In its simplest# form this setting is just a hostname[:port] setting. The default# port if none is specified is 1080. If your proxy requires a user# name, use the syntax user@host[:port]. If it also requires a# password use the format user:password@host[:port]. For example:# fred:secret@proxy.mydomain.com:8181# Default: none (use a direct connection)##proxy=## Option : ssl# Value : Whether or not to use the Secure Sockets Layer (SSL) for all# communication with the New Relic collector. Possible values are# true/on or false/off. In certain rare cases you may need to modify# the SSL certificates settings below.# Default: false#ssl=true## Option : ssl_ca_bundle# Value : The name of a PEM-encoded Certificate Authority (CA) bundle to use# for SSL connections. This very rarely needs to be set. The monitor# will attempt to find the bundle in the most common locations. If# you need to use SSL and the monitor is unable to locate a CA bundle# then either set this value or the ssl_ca_path option below.# Default: /etc/ssl/certs/ca-certificates.crt or# /etc/pki/tls/certs/ca-bundle.crt# Note : Can also be set with the -b command line option.##ssl_ca_bundle=/path/to/your/bundle.crt## Option : ssl_ca_path# Value : If your SSL installation does not use CA bundles, but rather has a# directory with PEM-encoded Certificate Authority files, set this# option to the name of the directory that contains all the CA files.# Default: /etc/ssl/certs# Note : Can also be set with the -S command line option.##ssl_ca_path=/etc/ssl/certs## Option : pidfile# Value : Name of a file where the server monitoring daemon will store it’s# process ID (PID). This is used by the startup and shutdown script# to determine if the monitor is already running, and to start it up# or shut it down.# Default: /tmp/nrsysmond.pid# Note : Can also be set with the -p command line option.##pidfile=/var/run/newrelic/nrsysmond.pid## Option : collector_host# Value : The name of the New Relic collector to connect to. This should only# ever be changed on advise from a New Relic support staff member.# The format is host[:port]. Using a port number of 0 means the default# port, which is 80 (if not using the ssl option – see below) or 443# if SSL is enabled. If the port is omitted the default value is used.# Default: collector.newrelic.com##collector_host=collector.newrelic.com## Option : timeout# Value : How long the monitor should wait to contact the collector host. If# the connection cannot be established in this period of time, the# monitor will progressively back off in 15-second increments, up to# a maximum of 300 seconds. Once the initial connection has been# established, this value is reset back to the value specified here# (or the default). This then sets the maximum time to wait for# a connection to the collector to report data. There is no back-off# once the original connection has been made. The value is in seconds.# Default: 30##timeout=30
Thanks for posting the steps. This is what we were looking for installing the agent on one of our Ubuntu based server.