Install for other Linux (New Relic Servers)

For the latest, most advanced host monitoring, check out New Relic Infrastructure.

Servers for Linux provides a binary tarball that can be installed manually on any modern Linux-based operating system with glibc 2.5+. This section also describes how to use configuration management software to install Servers for Linux and includes a Puppet manifest example.

These instructions are for advanced Linux users. If you are a Debian, Ubuntu, RedHat or CentOS user, refer to the procedures for Ubuntu and Debian or RedHat and CentOS for easier installation and long-term maintenance.

Installation procedures

To install Servers for Linux via binary tarball:

1. Recommended: Setup the newrelic user

We recommend running the monitor as its own user. On our supported platforms we use a user named newrelic. Here we create and configure a user of the same name.

create the home, config and log locations

mkdir /opt/newrelic
mkdir /etc/newrelic
mkdir /var/log/newrelic

add the group and user

groupadd -r newrelic
useradd -r -g newrelic -d /opt/newrelic -s /sbin/nologin -c "New Relic monitoring daemon" newrelic

setting ownership on these locations for the new user and group

chown newrelic:newrelic /opt/newrelic
chown newrelic:newrelic /etc/newrelic/
chown newrelic:newrelic /var/log/newrelic
chmod 600 /etc/newrelic/

Remember that you need to configure startup to use this user. We use the RUNAS command in /etc/default/newrelic-sysmond for Debian and in /etc/sysconfig/newrelic-sysmond for Red Hat

2. Download the binary tarball

Download the tarball from https://download.newrelic.com/server_monitor/release/.

For the following commands, ensure you replace X.X.X.X with the correct version number.

3. Extract the tarball
tar xvfz newrelic-sysmond-X.X.X.X-linux.tar.gz
4. Copy program files

Copy nrsysmond-config and the appropriate nrsysmond binary to /usr/local/sbin.

32-bit architectures:

cp newrelic-sysmond-X.X.X.X-linux/daemon/nrsysmond.x86 /usr/local/sbin/nrsysmond
cp newrelic-sysmond-X.X.X.X-linux/scripts/nrsysmond-config /usr/local/sbin

64-bit architectures:

cp newrelic-sysmond-X.X.X.X-linux/daemon/nrsysmond.x64 /usr/local/sbin/nrsysmond
cp newrelic-sysmond-X.X.X.X-linux/scripts/nrsysmond-config /usr/local/sbin

Copy the configuration file to /etc/newrelic as root:

cp newrelic-sysmond-X.X.X.X-linux/nrsysmond.cfg /etc/newrelic/nrsysmond.cfg

You may also chmod 600 the configuration file and chown it to the user the nrsysmond process will run as.

5. Configure your license key

Use nrsysmond-config to specify your New Relic license key. Your New Relic license key appears in the Account Information section of your Account settings page.

Run the following as root:

/usr/local/sbin/nrsysmond-config --set license_key=YOUR_LICENSE_KEY

Alternatively, you can edit /etc/newrelic/nrsysmond.cfg and identify the license_key setting there.

6. Install startup scripts (optional)

New Relic provides the RedHat and Debian startup scripts as a base for your own startup scripts. Edit the scripts as needed, and then copy them to the appropriate location on your system; for example, /etc/init.d. Be sure to run any commands required to ensure the server monitor restarts after a system shutdown.

7. Start Servers for Linux

Start Servers for Linux by using either of these methods:

  • Startup script; for example:

    /etc/init.d/newrelic-sysmond start
  • Command line: Run the nrsysmond command from the command prompt:

    /usr/local/sbin/nrsysmond -c /etc/newrelic/nrsysmond.cfg

Verify that a message indicates that nrsysmond has started successfully. Wait a few minutes, then view your server in the Servers UI.

8. Rotating your logs (optional)

We can use logrotate to handle our log files. Here is an example script that can be saved to /etc/logrotate.d/newrelic-sysmond:

/var/log/newrelic/nrsysmond.log {
    rotate 7
    daily
    missingok
    notifempty
    sharedscripts
    copytruncate
    compress
}

Configuration management software

Servers for Linux needs very few files on the file system. The minimum requirements are the agent binary nrsysmond and the configuration file nrsysmond.cfg. If you want to use configuration management software, use a startup script that fits into your host's startup system (such as init or upstart). You will also need to store log files and a PID file.

The binary and the config file do not need to be different for each server. They can be stored on shared storage, and the log file and PID file locations can be specified by using the command line.

Puppet manifest example
class server_agent {
  package {
    "newrelic-sysmond":
      ensure => latest;
  }

  service {
    "newrelic-sysmond":
      enable => true,
      ensure => running,
      hasstatus => true,
      require => [ Package["newrelic-sysmond"], File["/etc/newrelic/nrsysmond.cfg"] ];
  }

  file {
    "/etc/newrelic/nrsysmond.cfg":
      mode => 640,
      owner => root,
      group => newrelic,
      require => Package['newrelic-sysmond'],
      notify => Service['newrelic-sysmond'],
      source => "puppet:///files/newrelic/nrsysmond.cfg";
  }
}

Uninstall procedures

New Relic recommends that you follow standard procedures to uninstall Servers for Linux. For more information, refer to the procedures for Ubuntu and Debian or RedHat and CentOS as applicable.

Advanced users who used the tarball installation method may want to stop the service and remove the files. This includes:

  • Stopping the nrsymond service; for example:

    etc/init.d/newrelic-sysmond stop
  • Removing program files; for example:

    rm /etc/newrelic/nrsysmond.cfg /var/log/newrelic/nrsysmond.*
  • Removing other files from the location where you stored them, including nrsysmond and nrsysmond-config

  • Removing the directories where nrsysmond config and log files were stored, if they are empty; for example:

    rmdir /etc/newrelic /var/log/newrelic

For more help

Additional documentation resources include:

Discuss New Relic Servers in the New Relic Online Technical Community! Troubleshoot and ask questions, or discuss Servers for Linux or Servers for Windows in detail.

If you need additional help, get support at support.newrelic.com.