One time you have completed the installation Nagios-plugin and nrpe , if you find an error on the Nagios monitoring page when configuring in the client system,
Current Status: UNKNOWN (for 0d 0h 3m 13s)
Status Information: /bin/ping -n -U -w 30 -c 5 host5.hostname.com
CRITICAL - Could not interpret output from ping comman
Status Information: /bin/ping -n -U -w 30 -c 5 host5.hostname.com
CRITICAL - Could not interpret output from ping comman
We can easily fixed this issue just execute below commands,
Check file permission:
# ls -al /bin/ping
-rwxr-xr-x 1 root root 35864 Dec 21 2006 /bin/ping*
-rwxr-xr-x 1 root root 35864 Dec 21 2006 /bin/ping*
Give permission to that executable file,
# chmod u+s /bin/ping
u => File owner.
s => Set-user-ID-on-execution permission if the u flag is specified
# ls -al /bin/ping
-rwsr-xr-x 1 root root 35864 Dec 21 2006 /bin/ping*
-rwsr-xr-x 1 root root 35864 Dec 21 2006 /bin/ping*
Following command returns the output "ping OK"
# /usr/local/nagios/libexec/check_ping -H host5.hostname.com -w 3000.0,80% -c 5000.0,100% -p 5
PING OK - Packet loss = 0%, RTA = 0.09 ms|rta=0.092000ms;3000.000000;5000.000000;0.000000 pl=0%;80;100;0
(or)
Current Status: OK (for 0d 0h 56m 13s)
Status Information: PING OK - Packet loss = 0%, RTA = 0.07 ms
Performance Data: rta=0.067000ms;3000.000000;5000.000000;0.000000 pl=0%;80;100;0
PING OK - Packet loss = 0%, RTA = 0.09 ms|rta=0.092000ms;3000.000000;5000.000000;0.000000 pl=0%;80;100;0
(or)
Current Status: OK (for 0d 0h 56m 13s)
Status Information: PING OK - Packet loss = 0%, RTA = 0.07 ms
Performance Data: rta=0.067000ms;3000.000000;5000.000000;0.000000 pl=0%;80;100;0
Nagios Server Side configuration for that particular host,
# vim /usr/local/nagios/etc/objects/host4.hostname.cfg
define service{
use generic-service
host_name host2.hostname.com
service_description Host Status
check_command check_ping! -H 192.168.0.10
}
define service{
use generic-service
host_name host2.hostname.com
service_description Host Status
check_command check_ping! -H 192.168.0.10
}
Note : 192.168.0.10 is your Client server ip address.
Better use posix capabilities: setcap cap_net_raw+ep /bin/ping ast