You can build NRPE from source quite simply:
Prerequisites
Make sure that you have the following packages installed:
Code: Select all
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:
Code: Select all
cd /tmp
wget http://sourceforge.net/projects/nagios/files/nrpe-2.x/nrpe-2.15/nrpe-2.15.tar.gz
tar zxvf nrpe-2.15.tar.gz
Compile and Installation
To compile and install NRPE, run the following commands:
Code: Select all
useradd nagios
cd nrpe-2.15
./configure
make
make install
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:
Code: Select all
mkdir /usr/local/nagios/etc
cp sample-config/nrpe.cfg /usr/local/nagios/etc
Install xinetd
Once NRPE has been installed, you need to set up an init system - typically this is xinetd.
Many linux distributions come with xinetd pre-installed.
CentOS/RHEL/Fedora:
Ubuntu/Debian:
Configure 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:
Code: Select all
cd /tmp/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:
Change:
To:
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:
Code: Select all
echo "nrpe 5666/tcp" >> /etc/services
Let's test NRPE/xinetd to make sure it starts up cleanly:
Code: Select all
service xinetd start
cd /usr/local/nagios/libexec
./check_nrpe -H 127.0.0.1
You should see the following output:
NRPE v2.15
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):
Code: Select all
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