Hi,

I am refering to an articel in the mail archive
(http://www.mail-archive.com/[email protected]/msg00803.html).
It is about the chance to do an "exec" after a specified number of
restarts of a process.
The problem is, that in this particular case the responsible statement
won't work with "exec".
Only "timeout" is accepted.

Martin wrote a hint for fixing the problem in an other way.
But...
:-) that fix is not for me.

I do something like that in monitrc file:

...
check process apache2 with pidfile /var/run/apache2.pid
 group www-data
 start program = "/etc/init.d/apache2 start"
 stop  program = "/etc/init.d/apache2 stop"

 if cpu > 60 % for 2 cycles then alert
 if cpu > 80 % for 5 cycles then restart
 if children > 250 then restart
 if failed host mywebhost.uni-wuppertal.de port 443 type tcpssl protocol
http request "/mymonit.html" then restart

...

Now, I would like to write something like this:

 if 3 restarts within 5 cycles then exec "/etc/monit/shutmedown.sh"

In either case the exec has to be done, because the systemload and / or
the heavy number of children indicates an attack (max systemload in
normal production on the server is lower 50 %) and we can't do anything
against it - or there went something wrong with apache2 and we want to
know the system down.

With "exec" I want to start a shutdown-script by my own.
After that, the servermirror will notice the absence of the
productionsystem (signaled by heartbeat) and starts up apache2 and some
other services.


How can I make that work?


Carsten



--------------------------------------------
 Bergische Universitaet Wuppertal
 Dezernat 2.3
 Gaussstr.20
 D-42097 Wuppertal (Germany)
--------------------------------------------
 phone: +49 202 439-3804
 fax:   +49 202 439-2916
 email: [EMAIL PROTECTED]
--------------------------------------------


--
To unsubscribe:
http://lists.nongnu.org/mailman/listinfo/monit-general

Reply via email to