Page 1 of 1

check_http configuration

Posted: Mon Oct 03, 2011 9:35 pm
by GaWd
I am trying to construct a check_http command that will alert me to the actual PRESENCE of a text string, not the ABSENCE. I oftentimes use the –s flag to specify the absence of a certain text string. How can I do the opposite, though? I want to have Nagios check a webpage, and when it gets a text-based message of “(DATABASE ERROR)” I want it to begin alerting.

Is there a way with check_http to do this?

Re: check_http configuration

Posted: Tue Oct 04, 2011 10:47 pm
by GaWd
The answer happened to be under my nose, but the text on the manpages was too small or something:

-R, --eregi=STRING
Search page for case-insensitive regex STRING
--invert-regex
Return CRITICAL if found, OK if not


define command {
command_name command_dberror
command_line $USER1$/check_http -H $HOSTADDRESS$ -u "/url" -R "DATABASE ERROR" --invert-regex
}