Centos 6 – Install Nagios client from source

Published on Author gryzli

We are assuming that our Nagios Server has IP: 192.168.1.1

By default client NRPE will listen on port 5666, so make sure it’s enabled on IPTABLES.

Prerequisities

Add nagios user

useradd nagios

 

Install openssl devel

yum install openssl-devel

 

Install xinetd

yum install xinetd

 

 

Install Nagios NRPE

Current version of NRPE is 2.15.

cd /usr/src

wget 'http://sourceforge.net/projects/nagios/files/nrpe-2.x/nrpe-2.15/nrpe-2.15.tar.gz/download' -O nrpe-2.15.tar.gz

tar xvzf nrpe-2.15.tar.gz && cd nrpe-2.15

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

 

Install Nagios Plugins

cd /usr/src

wget 'http://nagios-plugins.org/download/nagios-plugins-2.0.3.tar.gz'

tar xvzf nagios-plugins-2.0.3.tar.gz && cd nagios-plugins-2.0.3

./configure --prefix=/usr/local/nagios
make
make install

 

Allow Nagios Server connections

1. OpenĀ /usr/local/nagios/etc/nrpe.cfg and change:

#....
# The IP of our Nagios Server
allowed_hosts=192.168.1.1 
#....

2. OpenĀ /etc/xinet.d/nrpe

#....     
   only_from       = 192.168.1.1
#....

3. Open /etc/services and ensure there is the following line

# ....
nrpe 5666/tcp
# ....

 

Restart xinetd and enable by default

/etc/init.d/xinetd restart

chkconfig xinetd on

 

Finally try to issue nrpe command from the Nagios server

Logon to your Nagios Server and issue the following:

# We assume that "192.168.1.2" is the IP of the Nagios client
/usr/local/nagios/libexec/check_nrpe -H 192.168.1.2 -c check_load

Results in something like that:

OK – load average: 0.01, 0.03, 0.00|load1=0.010;15.000;30.000;0; load5=0.030;10.000;25.000;0; load15=0.000;5.000;20.000;0;