check_http negative matching

Marc Powell marc at ena.com
Tue Dec 16 17:28:33 CET 2008


On Dec 16, 2008, at 9:57 AM, Sean Carolan wrote:

> I have a particular web page that I would like to monitor for the word
> "ERROR".  It should be a negative match, so that if the word is found
> an alert is sent.  The normal behavior of his monitor is to alert if
> the search string is not found.  How do I reverse this?

With the negate plugin.

$ ./negate --help
negate v1859 (nagios-plugins 1.4.11)
Copyright (c) 2002-2007 Nagios Plugin Development Team
	<nagiosplug-devel at lists.sourceforge.net>

Negates the status of a plugin (returns OK for CRITICAL and vice-versa).
Additional switches can be used to control which state becomes what.


Usage:negate [-t timeout] [-owcu STATE] <definition of wrapped plugin>

Options:
[chopped]

Examples:
  negate /usr/local/nagios/libexec/check_ping -H host
     Run check_ping and invert result. Must use full path to plugin
  negate -w OK -c UNKNOWN /usr/local/nagios/libexec/check_procs -a 'vi  
negate.c'
     This will return OK instead of WARNING and UNKNOWN instead of  
CRITICAL

Notes:
This plugin is a wrapper to take the output of another plugin and  
invert it.
The full path of the plugin must be provided.
If the wrapped plugin returns OK, the wrapper will return CRITICAL.
If the wrapped plugin returns CRITICAL, the wrapper will return OK.
Otherwise, the output state of the wrapped plugin is unchanged.


------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list