Page 1 of 1

check_http

Posted: Mon Jul 28, 2014 10:08 am
by veenm
Hi Team,

I have one requirment , i need to search for 2 string that is a AND condition means if both strings are present then only alert has to be triggered. Lets say i have a XML URL output like below.

<ROOT><ALERT><DATE></DATE><EVENTID>0</EVENTID><SYSTEM>WRKL</SYSTEM><SUBJECT>SRV</SUBJECT><COMPUTER>xxxx</COMPUTER><DESCRIPTION></DESCRIPTION></ALERTxxxxxxxxx><ALERT><DATE></DATE><EVENTID>0</EVENTID><SYSTEM>WRKL</SYSTEM>xxxxx<SUBJECT>APPL</SUBJECT><COMPUTER></COMPUTER><DESCRIPTION></DESCRIPTION></ALERT><ALERT><DATE></DATE><EVENTID>0</EVENTID>xxxx<SYSTEM>WRKL</SYSTEM><SUBJECT>BUILD</SUBJECT><COMPUTER></COMPUTER>xxxx<DESCRIPTION></DESCRIPTION></ALERT>xxxxxxx</ROOT>


If <EVENTID>0</EVENTID> AND <SUBJECT>SRV</SUBJECT> are present then only alert needs to be triggred . How can i monitoring this using check_http plugin using -r as a option.
Please let me know.

Re: check_http

Posted: Mon Jul 28, 2014 12:50 pm
by sreinhardt
check_http will not do what you are looking for, as the string matching would essentially be OR logic, in the sense that both strings are checked separately, if either is true or both are, you will get a true result back, there is no way to change this to AND. I would instead suggest looking at something like weblogic or selenium checks instead. You could also write a custom script to handle this same logic with curl or something similar.

Re: check_http

Posted: Wed Aug 13, 2014 11:21 am
by veenm
Hi ,

Thank for the reply , i have written a script using curl and grep -e logic. now script is working totally fine. I want to pass a sting in double quotes ("") to nrpe from nagios . Is that possible to pass the string in double quotes . If yes please let me know who can i do that .

Re: check_http

Posted: Wed Aug 13, 2014 5:05 pm
by abrist
NRPE Considers double quotes to illegal characters. You can base encode the string before you pass it through nrpe, or you could try to use the master branch of nrpe on github:
https://github.com/NagiosEnterprises/nrpe
Eric merged my patch which removed double quotes as nasty metas.