Page 1 of 1

check_ping works in ssh but not on web-gui?

Posted: Tue Jun 04, 2013 1:23 am
by staun
Is there a difference on the check_ping call when running the command from ssh vs. webgui?

It seems that mine fails on the WebGUI.

from SSH
[root@srv-mon-nsb1 libexec]# ./check_ping -H srv-files-nsb1 -w 10,100% -c 50,100%
PING OK - Packet loss = 0%, RTA = 0.41 ms|rta=0.415000ms;10.000000;50.000000;0.000000 pl=0%;100;100;0

from WebGUI
COMMAND: /usr/local/nagios/libexec/check_ping -H srv-web-nsb1 -w 10,100% -c 50,100% -p 5
OUTPUT: PING CRITICAL - Packet loss = 100%|rta=50.000000ms;10.000000;50.000000;0.000000 pl=100%;100;100;0

Re: check_ping works in ssh but not on web-gui?

Posted: Tue Jun 04, 2013 3:28 pm
by sreinhardt
Just to verify, are you getting this output from the test command button or by letting the command run via normal nagios scheduler? Otherwise to my knowledge there is not a difference, unless selinux or something does not give the executing user permission to exit the system with a ping.

Re: check_ping works in ssh but not on web-gui?

Posted: Thu Jun 06, 2013 1:12 am
by staun
This is run from a SSH command line when it has success with the PING.

Re: check_ping works in ssh but not on web-gui?

Posted: Thu Jun 06, 2013 11:18 am
by abrist
Is selinux enabled?

Code: Select all

getenforce
Can you run the check from the cli as user apache?

Code: Select all

su - apache -c "./check_ping -H srv-web-nsb1 -w 10,100% -c 50,100% -p 5" 
Have you tried configuring the check in XI and letting the nagios scheduler run the check normally (rather than using the test check command button).

Re: check_ping works in ssh but not on web-gui?

Posted: Fri Jun 07, 2013 12:49 am
by staun
hmm cannot run this command with the user apache.

Code: Select all

[root@srv-mon-nsb1 libexec]# su - apache -c "./check_ping -H srv-web-nsb1 -w 10,100% -c 50,100% -p 5"
This account is currently not available.

Re: check_ping works in ssh but not on web-gui?

Posted: Fri Jun 07, 2013 10:47 am
by lmiltchev
Run the following commands and show the output:

Code: Select all

ll /bin/ping
ll /usr/local/nagios/libexec/check_ping