check_http: fail if word appears on page?

Andrew Cruse andrew at profitability.net
Mon May 22 17:44:24 CEST 2006


nagios-users-admin at lists.sourceforge.net wrote:
> I've got a case where I'm monitoring a web site that throws
> up a message saying 'This site is undergoing maintenance'
> when there is a problem with the backend servers.. is there a
> way with check_http to verify that the word maintenance does *not*
> appear on the page? 
> 
> I've tried using the regex engine, but haven't figured out a way to
> negate the regexp. 
> 
> Any suggestions would be appreciated!

You might check out "negate" which I believe is part of the standard
plugin distro:

negate (nagios-plugins 1.4.0alpha1) 1.13
The nagios plugins come with ABSOLUTELY NO WARRANTY. You may
redistribute
copies of the plugins under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.
Copyright (c) 2002-2003 Nagios Plugin Development Team
        <nagiosplug-devel at lists.sourceforge.net>

Negates the status of a plugin (returns OK for CRITICAL, and
vice-versa).

Usage: negate [-t timeout] <definition of wrapped plugin>
       negate (-h | --help) for detailed help
       negate (-V | --version) for version information

Options:
 -h, --help
    Print detailed help screen
 -V, --version
    Print version information
 -t, --timeout=INTEGER
    Seconds before connection times out (default: 9)
     [keep timeout than the plugin timeout to retain CRITICAL status]
  negate "/usr/local/nagios/libexec/check_ping -H host"
    Run check_ping and invert result. Must use full path to plugin
  negate "/usr/local/nagios/libexec/check_procs -a 'vi negate.c'"
    Use single quotes if you need to retain spaces
This plugin is a wrapper to take the output of another plugin and invert
it.
If the wrapped plugin returns STATE_OK, the wrapper will return
STATE_CRITICAL.
If the wrapped plugin returns STATE_CRITICAL, the wrapper will return
STATE_OK.
Otherwise, the output state of the wrapped plugin is unchanged.

Send email to nagios-users at lists.sourceforge.net if you have questions
regarding use of this software. To submit patches or suggest
improvements,
send email to nagiosplug-devel at lists.sourceforge.net


Andrew



-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
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