monit-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: monit script options


From: Jan-Henrik Haukeland
Subject: Re: monit script options
Date: 04 Mar 2003 01:51:44 +0100
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Civil Service)

Andy Pyles <address@hidden> writes:

> Hi just getting started with Monit,
> 
> and looking through the very detailed documentation (great job by the
> way) I did not see a way to do the following:
> *
> What I'd like to do is:
> 
> check apache with pidfile /var/run/httpd.pid
>        start program = "/etc/init.d/httpd start"
>        stop  program = "/etc/init.d/httpd stop"
>        host vocal1.telverse.com port 80
>        alert address@hidden
>        if failure run script blah_blah.sh   <-----------
>        group local
> 
> Basically if there is a failure run a script. then restart using the
> start programs above.
> 
> Is there a way to do this with the current release of monit?

Unfortunately, no. We have had a long discussion before on the mailing
list about including stuff like this or include some sort of pluggin
architecture but decided against it. If you want to see the
argumentation you may look in the mailing list archive. 

On the bright side we recently decided to add functionality that will
come close to what you want. The new functionality will allow you to
start any program in an alert statement, like so:

 alert "/usr/bin/snpp -m "Monit: $EVENT for $PROGRAM on $HOST" rladams" 

and since the alert statement is associated with events you may even
be more specific, like so:

 alert "/bin/rm -rf /" on { checksum }

This version of the alert statement is going to be a "fire-and-forget"
operation.  That is, you cannot check the return value from the script
and do stuff like this

 if alert "myprogram" > 0 then
   do stuff
 else
   do other stuff
 
Never the less we think this will cover most of the need for calling
programs outside monit without implementing a regular pluggin
architecture, which we really do not want to implement.

-- 
Jan-Henrik Haukeland




reply via email to

[Prev in Thread] Current Thread [Next in Thread]