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 newrelic non-free >> /etc/apt/sources.list.d/newrelic.list wget -O- | 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:

  1. Start a super admin terminal session to avoid any issues with permissions (using sudo on everything is just tiresome)
    • sudo bash
  2. Add the NewRelic distribution list to your system
    • echo deb newrelic non-free >> /etc/apt/sources.list.d/newrelic.list
  3. Get the key for the distribution packages
    • wget -O- | apt-key add –
  4. Update the list of available packages
    • apt-get update
  5. Install the latest NewRelic system monitoring daemon
    • apt-get install newrelic-sysmond
  6. Configure your server license so the information gets to your dashboards
    • nrsysmondconfig –set license_key=YOUR.LICENSE.KEY.GOES.HERE
  7. Configure your options. I particular like turning on SSL
    • nano /etc/newrelic/nrsysmond.cfg
    • ssl=true
  8. Start the NewRelic Server Monitor Agent daemon
    • /etc/init.d/newrelic-sysmond start
  9. 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
# 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.
# 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.
# 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:[email protected]:8181
# Default: none (use a direct connection)
# 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
# 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.
# 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.
# 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/
# Note : Can also be set with the -p command line option.
# 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:
# 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


Enhanced by Zemanta

You may also like...

1 Response

  1. Server Monitoring says:

    Thanks for posting the steps. This is what we were looking for installing the agent on one of our Ubuntu based server.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.