Page 1 of 1
HTTP Content - String containing quotation marks
Posted: Thu Aug 19, 2021 9:42 am
by danallery
Hi there,
I am trying to use check_xi_service_http to search for:
"sealed":false
However the " marks are removed during the parse time. How do I force these to be searched for by the command?
Re: HTTP Content - String containing quotation marks
Posted: Thu Aug 19, 2021 4:50 pm
by pbroste
Hello @danallery
Thanks for reaching out; understand that you want to check for "text".
Code: Select all
./check_http -H www.yourwebsite.com -s ""sealed":false"
I am thinking that we may require the quotes around the complete search, even though it is searching for
"sealed":false (will need to test).
Thanks,
Perry
Re: HTTP Content - String containing quotation marks
Posted: Fri Aug 20, 2021 4:19 am
by danallery
Thanks for the reply, Perry. I did initially try that method, however it would seem that any " quotation marks are ignored that sit within the first and last quotation mark.
I have read this...
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
and found this:
Note that certain special characters need to be escaped. For instance, the < should be replaced with \x3C so
as not to interfere with the XML. Within POST data URL escapes are used, so for instance @ becomes %40.
The problem is I do not know how to format the string, utilizing the scape characters... or what the escape character for " is!
Re: HTTP Content - String containing quotation marks
Posted: Fri Aug 20, 2021 6:50 am
by danallery
I resolved this by using the check_Json function in the end. The page I was monitoring was JSON attribute output, so worked fine.
Re: HTTP Content - String containing quotation marks
Posted: Fri Aug 20, 2021 11:11 am
by pbroste
Hello @danallery
Thanks for following up and providing the plugin that worked for your use case, this will help others as well. I will go ahead and lock this.