Could not interpret output from ping command


OK, as promised, I’m back with another problem :). Hopefully this will be the last. I now have Nagios 3.2.3 running and things seem fine except for the ping monitoring, which keeps telling me localhost is down, when it’s not. Looking into it a bit, it turns out that Nagios can’t interpret the ping command output. There is a similar thread here, but the problem is not exactly the same and it is not really resolved anyhow, so I decided to start a new thread.



[quote]# ‘check-host-alive’ command definition
define command{
command_name check-host-alive
command_line $USER1$/check_ping -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 5

‘check_ping’ command definition

define command{
command_name check_ping
command_line $USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5

Host Status Information:

[quote]Status Information: /bin/ping -n -U -w 30 -c 5
CRITICAL - Could not interpret output from ping command[/quote]

When I run the ping command manually from command line, the output looks fine as far as I can see:

[quote]# /bin/ping -n -U -w 30 -c 5
PING ( 56(84) bytes of data.
64 bytes from icmp_seq=1 ttl=64 time=0.053 ms
64 bytes from icmp_seq=2 ttl=64 time=0.041 ms
64 bytes from icmp_seq=3 ttl=64 time=0.036 ms
64 bytes from icmp_seq=4 ttl=64 time=0.041 ms
64 bytes from icmp_seq=5 ttl=64 time=0.062 ms

— ping statistics —
5 packets transmitted, 5 received, 0% packet loss, time 4000ms
rtt min/avg/max/mdev = 0.036/0.046/0.062/0.012 ms[/quote]

I have not made any changes to the original configuration files. If you need any further info, please let me know.

Thanks for any pointers I can get on this!


OK, so it would appear that the ping command only works as root, and not as nagios, and that is causing the output weirdness.

When trying to run ping as nagios user, the output is:

So I take it ICMP is disabled for non-root users. What should I do about this?



Is SELinux enabled? different firewall rules for different users?