Page 1 of 1

Check_Ping not working

Posted: Fri Mar 02, 2012 11:15 am
by yctsai1
After getting latest stable release Nagios Core installed on Cent OS 6.2 x86, I get Host Status: Down. Looking at the ping, I think the check_ping is not working but not sure why or how to fix this. Looks almost as if check_ping can't find /bin/ping ? where is this defined ?

Output:

[root@monitor libexec]# ./check_ping -H 10.2.2.2 -w 3000.0,80% -c 5000.0,100% -p 5
ping
CRITICAL - Could not interpret output from ping command

Re: Check_Ping not working

Posted: Fri Mar 02, 2012 3:38 pm
by lmiltchev
What is the output of these commands?

Code: Select all

which ping
ls -l /bin/ping
ls -l /usr/local/nagios/libexec | grep ping
Check if in "cgi.cfg" file you have a line that says:

Code: Select all

ping_syntax=/bin/ping -n -U -c 5 $HOSTADDRESS$

Re: Check_Ping not working

Posted: Fri Mar 02, 2012 4:17 pm
by yctsai1
>which ping
/bin/ping

>ls -l /bin/ping
-rwsr-xr-x. 1 root root 36892 Jul 19 2011 /bin/ping

>ls -l /usr/local/nagios/libexec | grep ping
-rwxr-xr-x. 1 nagios nagios 107499 Mar 2 10:39 check_ping

cgi.cfg does contain "ping_syntax=/bin/ping -n -U -c 5 $HOSTADDRESS$" without comment #
-------------------------------------------------------------------------------------------------

Nagios website itself reports the host is unreachable after installation.

I look at the config files of Nagios, following its syntax for check_ping and posted the result on my previous post.

I am suspecting either Nagio's check_ping statement can't find ping or ping6 or there is other permissions issues that it can't read the results.

None of the install directions on the web correctly installs latest Nagios with Cent OS 6.2.
First error was Nagios Plugin didn't compile correctly which was fixed with adding,
--with-ping-command=ping

Second error was Internal server error which was a permissions issue that can be fixed by:
chcon -R -t httpd_sys_content_t /usr/local/nagios/sbin/
chcon -R -t httpd_sys_content_t /usr/local/nagios/share/

So my third issue is Host not responding to ping correctly as reported by Nagios. And I am 'guessing' it's the check_ping not working. However, I am not sure.

I've looked at multiple installation documents and they are looks the same. The first two fixes should be added to everyone's install doc, hopefully.