check_ping works in ssh but not on web-gui?

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
staun
Posts: 17
Joined: Thu Oct 11, 2012 3:42 am

check_ping works in ssh but not on web-gui?

Post 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
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

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

Post 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.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
staun
Posts: 17
Joined: Thu Oct 11, 2012 3:42 am

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

Post by staun »

This is run from a SSH command line when it has success with the PING.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

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

Post 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).
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
staun
Posts: 17
Joined: Thu Oct 11, 2012 3:42 am

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

Post 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.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

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

Post by lmiltchev »

Run the following commands and show the output:

Code: Select all

ll /bin/ping
ll /usr/local/nagios/libexec/check_ping
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked