NRPE client enables Nagios to query and use plugins remotely from Linux and Windows servers. This one is about Linux client.
install software with yum
<code>
yum install nagios-nrpe nagios-plugins nagios-plugins-nrpe
</code>
use nrpe daemon or xinetd, this one uses daemonized nrpe
<code>
vi /etc/nagios/nrpe.cfg
</code>
fix allowedhosts according to your environment
* fix the check commands according to your environment (w = warning, c = critical limit)
<code>
command[checkusers]=/usr/lib64/nagios/plugins/checkusers -w 5 -c 10
command[checkload]=/usr/lib64/nagios/plugins/checkload -w 10,7,4 -c 20,15,10
#command[checkload]=/usr/lib64/nagios/plugins/checkload -w 15,10,5 -c 30,25,20
command[checkrootv]=/usr/lib64/nagios/plugins/checkdisk -w 10% -c 5% -p /dev/mapper/vgmyserver-rootv
command[checkzombieprocs]=/usr/lib64/nagios/plugins/checkprocs -w 5 -c 10 -s Z
command[checktotalprocs]=/usr/lib64/nagios/plugins/checkprocs -w 350 -c 400
</code>
if you wish you can describe the service to /etc/services, needed if xinetd is used
<code>nrpe 5666/tcp # Nagios NRPE</code>
make iptables allow rules if necessary
<code>
iptables -I INPUT -p TCP –dport 5666 -s nagios-server-ip
service iptables save
</code>
start nrpe daemon
<code>service nrpe start</code>
do testing in client
<code>/usr/lib64/nagios/plugins/checknrpe -H localhost</code>
<code>/usr/lib64/nagios/plugins/checknrpe -H localhost -c checkusers</code>
* do testing in nagios server
/usr/lib64/nagios/plugins/checknrpe -H client-ip
edit file /etc/nagios/objects/commands.cfg
<code>
define command{
commandname checknrpe
commandline $USER1$/checknrpe -H $HOSTADDRESS$ -c $ARG1$
}
</code>
add the host to nagios server
<code>vi /etc/nagios/objects/host.cfg</code>
example data for /etc/nagios/objects/host.cfg
<code>
define host{
use linux-server
hostname myhost
alias My Virtual server
address 192.168.1.2
}
define service{
use local-service,graphed-service
hostname myhost
servicedescription PING
checkcommand check_ping!100.0,20%!500.0,60%
}