Page 1 of 1

URL content monitoring

Posted: Thu Feb 15, 2018 4:35 am
by keerthi.seetharaman
Hello Team,
We are using your plugin check_http for our url monitoring via NagiosXI. 
We have a situation here, we have got a new request in which if the pattern “Test Failed” will appear in the content of the URL – the error should be generated. 
We tried by using -s and -R but no luck. 
By using -s“Test Failed” it is searching for the content and throwing Critical state if not found. But we want a reverse monitoring that if this pattern is found then it should throw Critical error.
Please help us for the same.
Do let me know, in case you need some more info.
Thanks in Advance.
Regards,
Keerthi Prashanth S

Re: URL content monitoring

Posted: Thu Feb 15, 2018 10:08 am
by cdienger
The -R option can be used to specifiy a regex string and --invert-regex used to return CRITICAL if found:

/usr/local/nagios/libexec/check_http -H <hostname> -R "Test Failed" --invert-regex

Re: URL content monitoring

Posted: Fri Feb 16, 2018 7:09 am
by keerthi.seetharaman
Thanks for your quick help.

Please go ahead and close this case.