Installing NRPE Using the Install Script
You must run the following commands as root.
For CentOS & RHEL 5-7, Fedora 14+, SLES & OpenSUSE 11+, Ubuntu 12+, Debian 6+:
For CentOS & RHEL 4:
Unpack the installer, and run the install script:
tar xzf linux-nrpe-agent.tar.gz
The script takes care of the following setup:
- Installs prerequisite packages
- Creates required users and groups
- Defines services for xinetd
- Compiles and installs the NRPE agent and Nagios plugins
- Configures the firewall (except on SLES)
- Configures the agent
The script will stop to prompt you once to ask for the IP address(es) for your monitoring server(s).
You will need to type either a single address or multiple addresses separated by spaces. This will configure the xinetd superdaemon to allow connections from those addresses to the NRPE agent.
You now have NRPE installed. You may remove any installation files in the tmp directory.
Installing NRPE v2.15 From Source
This document describes how to install and configure NRPE v2.15 from source for use with Nagios Core/XI. The linux-nrpe-agent that ships with Nagios XI is only supported on CentOS, RHEL, OpenSUSE, SLES, Ubuntu, and Debian. Most monitored environments consist of many different distributions, therefore may need to compile NRPE and its associated plugins.
This procedure is intended for Nagios XI administrators who are new to NRPE or Nagios XI and have to use a source-based install method for NRPE, usually due to unsupported Linux distributions or security restrictions in corporate environments.
NRPE v3 has been released and you should instead refer to the following KB article for installing NRPE from source.
Only proceed with the steps below if you want to install v2.15.
Make sure that you have the following packages installed:
gcc glibc glibc-common openssl-devel perl
Downloading the Source
On the remote host (client system), log in as the root user to download and extract the NRPE tarball:
tar zxvf nrpe-2-15.tar.gz
Compile and Installation
To compile and install NRPE, run the following commands:
Note that if you want to pass arguments through NRPE you must specify this in the configuration option as indicated above. If you prefer to you can ommit the --enable-command-args flag. Removing this flag will require that all arguments be explicitly set in the nrpe.cfg file on each server monitored.
The check_nrpe plugin will install into /usr/local/nagios/libexec by default.
Copy the sample nrpe.cfg file to your remote hosts' NRPE config directory:
mkdir /usr/local/nagios/etc cp sample-config/nrpe.cfg /usr/local/nagios/etc
Once NRPE has been installed, you need to set up an init system - typically this is xinetd.
yum install xinetd
apt-get install xinetd
emerge -va xinetd
pacman -S xinetd
At this point, we need a configuration that tells xinetd about NRPE. This configuration is included - change directory to the NRPE source to install it:
cd /tmp/nrpe-nrpe-2-15 make install-xinetd
You should now have a config located at /etc/xinetd.d/nrpe - this file contains an "only_from" directive which specifies which ip addresses are allowed to talk to the daemon. It is a space separated list of ip addresses. Add your Nagios XI server's IP after the only_from setting:
only_from = 127.0.0.1
only_from = 127.0.0.1 x.x.x.x
Where x.x.x.x equals the IP address of your Nagios server.
Finally, we need to add the NRPE port and service declaration in /etc/services:
echo "nrpe 5666/tcp" >> /etc/services
Let's test NRPE/xinetd to make sure it starts up cleanly:
service xinetd start cd /usr/local/nagios/libexec ./check_nrpe -H 127.0.0.1
You should see the following output:
If you get the NRPE version number (as shown above), NRPE and xinetd are installed and configured correctly.
Downloading, Compiling, And Installing The Nagios Plugins
NRPE need plugins to operate properly. Before we dive into configuration, download and build the Nagios-plugins (visit Nagios-Plugins.org/downloads to find the latest version of the plugins and adjust the version number in the commands accordingly):
cd /tmp wget https://www.nagios-plugins.org/download/nagios-plugins-2.0.3.tar.gz tar zxvf nagios-plugins-2.0.3.tar.gz cd /tmp/nagios-plugins-2.0.3 ./configure --with-nagios-user=nagios --with-nagios-group=nagios make make install
This completes installing Nagios Plugins.
For any support related questions please visit the Nagios Support Forums at: