Procedure to isntall Nagios client :

1) useradd -M -s /sbin/nologin nagios

2) Check 32bit or 64 bit OS by uname -a
   Depending on that, download appropriate version

3) tar -xvf nagios.tar.gz 

4) cd nagios
   yum install perl-Digest-HMAC (This is a dependency, will install 2 rpms)

   rpm -ivh *.rpm               

5) Put below in /etc/hosts.allow
   nrpe:, add your Nagios server ip here	

6) Put below in /etc/sysconfig/iptables
   -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp -s nagios server ip here --dport 5666 -j ACCEPT
   /etc/init.d/iptables restart

7) Check by iptables -L
   If server is behind firewall, ensure 5666 port is opened for nagios ip here Server IP.

8) Edit /etc/nagios/nrpe.cfg
  a) Changed 'allowed_hosts' parameter to :
     allowed_hosts=,nagios ip here
  b) Add below as default params. Add more for other services. 

command[check_disk_slash]=/usr/lib/nagios/libexec/check_disk -w 20% -c 10% -p /
command[check_disk_boot]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /boot

9) /etc/init.d/nrpe start

10) Put nrpe service in startup
   a) chkconfig --level 3 nrpe on
   b) Verify by -> chkconfig --list | grep nrpe
   			 nrpe            0:off   1:off   2:off   3:on    4:off   5:off   6:off

12) Make changes on Monitoring server & reload nagios. 		

Sample commands in nrpe.cfg, you may check nrpe.cfg on other servers: 

command[check_disk_slash]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /
command[check_disk_boot]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /boot
command[check_disk_home]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /home
command[check_disk_opt]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /opt
command[check_disk_tmp]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /tmp
command[check_disk_usr]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /usr
command[check_disk_var]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /var
command[check_sendmail]=/usr/lib/nagios/plugins/check_process -C "sendmail: accepting connections"
command[check_mysql]=/usr/lib/nagios/plugins/check_process -C "/usr/libexec/mysqld"
command[check_httpd]=/usr/lib/nagios/plugins/check_process -C "httpd"
command[check_sshd]=/usr/lib/nagios/plugins/check_process -C "/usr/sbin/sshd"
command[check_java]=/usr/lib/nagios/plugins/check_process -C "/usr/java/jdk1.5.0_06/bin/java"

Post By Gishore J Kallarackal (2,121 Posts)

Gishore J Kallarackal is the founder of techgurulive. The purpose of this site is to share information about free resources that techies can use for reference. You can follow me on the social web, subscribe to the RSS Feed or sign up for the email newsletter for your daily dose of tech tips & tutorials. You can content me via @twitter or e-mail.

Website: → Techgurulive