check_http configuration

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
GaWd
Posts: 51
Joined: Wed Dec 15, 2010 1:45 pm

check_http configuration

Post 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?
GaWd
Posts: 51
Joined: Wed Dec 15, 2010 1:45 pm

Re: check_http configuration

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