1. add nagios user and set a password.
2. create nagcmd group and add nagios and apache to it.
(used to issue commands directly from web interface)
/usr/sbin/groupadd nagcmd
/usr/sbin/usermod -a -G nagcmd nagios
/usr/sbin/usermod -a -G nagcmd apache
3. download and install nagios plugin
cd /home/downloads
wget http://prdownloads.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.14.tar.gz
tar xfv nagios-plugins-1.4.14.tar.gz
cd nagios-plugins-1.4.11
./configure --with-nagios-user=nagios --with-nagios-group=nagios
make
make install
4. change the permissions
chown nagios.nagios /usr/local/nagios
chown -R nagios.nagios /usr/local/nagios/libexec
5. download and install nrpe plugin (nrpe uses 5666)
cd /home/downloads
wget http://prdownloads.sourceforge.net/sourceforge/nagios/nrpe-2.12.tar.gz
tar xfv nrpe-2.12.tar.gz
cd nrpe-2.12
./configure
make all
make install-plugin
make install-daemon
make install-daemon-config
make install-xinetd
6. nrpe configuration
vim /etc/xinetd.d/nrpe
only_from = 127.0.0.1 (change to nagios server ip address)
7. add nrpe port to services file
vim /etc/services
nrpe 5666/tcp # NRPE
8. service xinetd restart
9. testing nrpe
netstat -at |grep nrpe
output : tcp 0 0 *:nrpe *.* LISTEN
Read More !
