Executing a script based on text from a web page

dave stern - e-mail.pluribus.unum dit.dash at gmail.com
Fri Aug 6 17:38:47 CEST 2010


We've had a lot of luck with check_http with the params -u and -s
-u points to the particular path on the web server and -s is the
return string it expects.

And then there's the hacky way of doing it; wget the page and
search for presence/absence of a particular string

On Fri, Aug 6, 2010 at 10:16 AM, Joseph Devaney
<jdevaney at blackducksoftware.com> wrote:
> I know that nagios can monitor pages for certain text on that page to verify
> that its there.  In our organization we have several monitors like this
> currently setup and they work well for us.  I want to take this operability
> and apply it to a webpage that only appears when there is a server error and
> have it kick off a script to restart a service.
> This is for a website within the company.  When there are too many mysql
> connections, the site itself will not be displayed but will display a
> friendly error for us to perform a flush of the hosts.  This error doesnt
> occur often and when it does occur, it doesn't always happen when someone is
> awake to address it.  Basically what I want to happen is for nagios to
> monitor a website and if/when this error appears (I will set the
> check_command to look for the right text) nagios will execute a script to
> restart that service.  99% of the time, the site will be up and functioning
> as it should be, so I am not sure how to write this one up without giving a
> false positive on our monitors.
> Any thoughts on how to implement this?
>
>
>
> Joseph Devaney | Jr. Linux Systems Administrator | Black Duck Software | v:
> 781-810-1334  | m: 781-974-6729 | jdevaney at blackducksoftware.com | 265
> Winter St, Waltham, MA 02451
>
>
>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by
>
> Make an app they can't live without
> Enter the BlackBerry Developer Challenge
> http://p.sf.net/sfu/RIM-dev2dev
> _______________________________________________
> 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
>

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
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