Install Nagios NRPE from source code on CentOS or Debian

In order to monitor internal resources of remote systems with Nagios you will need NRPE installed and configured on a client. There will be two pieces to install NRPE daemon and nrpe plugins. This particular install was tested with CentOS and Debian.


Please not for some Debian distros the following fix was applied in order to get it to work.

cd /usr/lib
ln -s libssl.so.0.9.8 libssl.so

 

Create nagios user account and password.

/usr/sbin/useradd nagios
passwd nagios

Make directory where you will download nrpe daemon and plugins.

mkdir /downloads
cd /downloads

Download required packages.

wget http://nagios-plugins.org/download/nagios-plugins-2.0.tar.gz
wget http://sourceforge.net/projects/nagios/files/nrpe-2.x/nrpe-2.15/nrpe-2.15.tar.gz

Untar and install nagios plugin package.

tar xzf nagios-plugins-2.0.tar.gz
cd nagios-plugins-2.0
./configure
make
make install

Setup proper permissions.

chown nagios.nagios /usr/local/nagios
chown -R nagios.nagios /usr/local/nagios/libexec

Install xinetd service.

yum install xinetd #centos
sudo apt-get install xinetd #debian

Untar and install nrpe package.

tar xzf nrpe-2.15.tar.gz
cd nrpe-2.15

Run this only if you installing on Debian system.

cd /usr/lib
ln -s libssl.so.0.9.8 libssl.so

Continue for all systems.

./configure
make all
make install-plugin
make install-daemon
make install-daemon-config
make install-xinetd


Configure xinetd.

edit /etc/xinetd.d/nrpe
only_from = 127.0.0.1 <nagios_ip_address>
 

Configure nrpe.

edit /etc/services
nrpe 5666/tcp # NRPE

Restart xinetd for changes to take effect.

service xinetd restart

To test and make sure that nrpe is listening on port 5666.

netstat -at | grep nrpe
/usr/local/nagios/libexec/check_nrpe -H localhost

Expected result is NRPE v2.15

This guide only covers client side installation, there will be additional steps that we will need to run on Nagios server side to complete installation