check_http plugin failing to check content with single quote

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
bsanjay
Posts: 86
Joined: Mon Apr 29, 2019 9:38 am

check_http plugin failing to check content with single quote

Post 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
You do not have the required permissions to view the files attached to this post.
User avatar
vtrac
Posts: 903
Joined: Tue Oct 27, 2020 1:35 pm

Re: check_http plugin failing to check content with single q

Post 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
Locked