[Top][All Lists]

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

system-shutdown after <x> restarts within <y> cycles

From: markmann
Subject: system-shutdown after <x> restarts within <y> cycles
Date: Thu, 4 Jan 2007 16:06:17 +0100


I am refering to an articel in the mail archive
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.
:-) that fix is not for me.

I do something like that in monitrc file:

check process apache2 with pidfile /var/run/
 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 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/"

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?


 Bergische Universitaet Wuppertal
 Dezernat 2.3
 D-42097 Wuppertal (Germany)
 phone: +49 202 439-3804
 fax:   +49 202 439-2916
 email: address@hidden

reply via email to

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