Page 1 of 1
& in URL causes check_http to fail
Posted: Tue Sep 27, 2016 12:59 pm
by pbohn77
I cannot get a wsdl to work if it has an '&' in it.
Is there a list of reserved characters that will not work?
Re: & in an URL causes check_http to fail
Posted: Tue Sep 27, 2016 1:03 pm
by bwallace
Can't say that I've seen special characters cause check_http to fail...yet
Can you post the entire check command you're using as well as the results?
Re: & in URL causes check_http to fail
Posted: Tue Sep 27, 2016 1:20 pm
by pbohn77
I am using xi
the command is the check_http options are -p 10081 -u /GenericWebService/ws?service=WorkGroupService&appl=vantive&wsdl -s "getAllActiveAvailableWorkGroups"
that returns from the test command button
Test Check Command
Testing check from command line...
check_http -I bssapp.savvis.net -p 10081 -u /GenericWebService/ws\?service=WorkGroupService
OUTPUT: HTTP OK: HTTP/1.1 200 OK - 589 bytes in 0.018 second response time |time=0.017706s;;;0.000000 size=589B;;;0
if I run it from the command line on the nagios server I get
[root@dc2dccnagpd01 libexec]# ./check_http -H bssapp.savvis.net -p 10081 -u /GenericWebService/ws?service=WorkGroupService&appl=vantive&wsdl -s "getAllActiveAvailableWorkGroups"
[1] 13295
[2] 13296
-bash: wsdl: command not found
[2]+ Done appl=vantive
[root@dc2dccnagpd01 libexec]# HTTP OK: HTTP/1.1 200 OK - 589 bytes in 0.029 second response time |time=0.029294s;;;0.000000 size=589B;;;0
[1]+ Done ./check_http -H bssapp.savvis.net -p 10081 -u /GenericWebService/ws?service=WorkGroupService
[root@dc2dccnagpd01 libexec]#
then I make the test active and have it run in Xi.
Critical
(Return code of 127 is out of bounds - plugin may be missing)
it looks to me like anything after and including the & is not being looked for.
Re: & in URL causes check_http to fail
Posted: Tue Sep 27, 2016 1:32 pm
by pbohn77
If I quote the url on the command line it appears to work
[root@dc2dccnagpd01 libexec]# ./check_http -H bssapp.savvis.net -p 10081 -u '/GenericWebService/ws?service=WorkGroupService&appl=vantive&wsdl' -s getAllActiveAvailableWorkGroups
HTTP OK: HTTP/1.1 200 OK - 20968 bytes in 0.010 second response time |time=0.010184s;;;0.000000 size=20968B;;;0
[root@dc2dccnagpd01 libexec]#
If I quote it in the Xi gui
I get
COMMAND: /usr/local/nagios/libexec/check_http -I bssapp.savvis.net -p 10081 -u \'/GenericWebService/ws\?service=WorkGroupService
OUTPUT: HTTP WARNING: HTTP/1.1 400 Invalid URI - 130 bytes in 0.005 second response time |time=0.004650s;;;0.000000 size=130B;;;
But it passes when I save and have it run in Xi.
So the test check command does not work, but quoted the real check works.....??
Re: & in URL causes check_http to fail
Posted: Tue Sep 27, 2016 1:40 pm
by mcapra
pbohn77 wrote:
So the test check command does not work, but quoted the real check works.....??
The CLI is the final authority on what does/does not work when creating a check command. The "Test Command" component of the Nagios XI GUI is notoriously fickle (mostly due to PHP) and is getting an overhaul for 5.3.0.
Re: & in URL causes check_http to fail
Posted: Tue Sep 27, 2016 1:47 pm
by pbohn77
Cool, thanks.
Re: & in URL causes check_http to fail
Posted: Tue Sep 27, 2016 1:52 pm
by bwallace
- When you use the Test Check Command button, it runs as apache (where there are known escaping issues as mcapra mentioned)
- If the check is run organically, it runs as nagios.
Have you tried just configuring the check, and then applying configuration and allowing XI to perform the check normally?
Re: & in URL causes check_http to fail
Posted: Tue Sep 27, 2016 2:13 pm
by pbohn77
Yup.
That is what I will do from now on.
It's just that when it fails more people than just me get the alert emails. so if i fat finger something, I can't test it before I make it active.
This just makes it a longer process per test.
But I only have 80 more to go.
Re: & in URL causes check_http to fail
Posted: Tue Sep 27, 2016 3:24 pm
by rkennedy
To help prevent fat fingering, you could turn off notifications on individual hosts / services, and then enable once you're sure it works. Just throwing this out there as it may help you with testing.