Page 1 of 1

check_http plugin failing to check content with single quote

Posted: Wed Apr 21, 2021 2:35 pm
by bsanjay
Hello Team,
We are facing some weird issue where check command is working fine from CLI but failing on nagios dashboard & CCM. Please fine below screenshots of CLI & CCM for your reference.
So, we are facing issue when we are searching http content "I'm alive" (here single quote is specified in http search content), but when only searching for content "alive" (without single quote in http search content) we are getting the correct output.

Best Regards,
bsanjay

Re: check_http plugin failing to check content with single q

Posted: Thu Apr 22, 2021 2:06 pm
by vtrac
Hi,
Please try adding the "\" infront of the single quote "'".

Example, I have a double quote in my search string below:

Code: Select all

/usr/local/nagios/libexec/check_http -H "192.168.23.61" -s "/nagiosxi/about/?legal\">Legal</a>"
Outputs:

Code: Select all

HTTP OK: HTTP/1.1 200 OK - 3470 bytes in 0.001 second response time |time=0.000844s;;;0.000000 size=3470B;;;0
If adding the "\" does not work, please try using the "-r" (regular expression) option.


Best Regards,
Vinh