monit-general
[Top][All Lists]
Advanced

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

Re: [monit] stop restarting and exec other script at same time


From: Martin Pala
Subject: Re: [monit] stop restarting and exec other script at same time
Date: Sun, 7 Sep 2008 20:32:36 +0200

The only supported option for the mentioned statement is unmonitor/ timeout:

--8<--
  if <x> restarts within <y> cycles then timeout
--8<--

The statement disables the monitoring and sends alert to all corresponding recipients, you can set the sms on timeout only this way:

--8<--
  check process apache with pidfile /opt/apache_misc/logs/httpd.pid
    start program = "/etc/init.d/apache start"
    stop  program = "/etc/init.d/apache stop"
    if 5 restarts within 5 cycles then timeout
    alert address@hidden
    alert address@hidden only on {timeout}
--8<--

If you still need the exec action you can use the file check on the pidfile as workaround:

--8<--
  check apache_pid with path /opt/apache_misc/logs/httpd.pid
    if changed 5 times within 5 cycles then exec "do_sms"
--8<--


Martin


On Sep 7, 2008, at 7:29 PM, conandor wrote:


how can i put a stop and execute a script if monit fail to restart apache for
several time.

check process apache with pidfile /opt/apache_misc/logs/httpd.pid
  start program = "/etc/init.d/apache start"
  stop  program = "/etc/init.d/apache stop"
  if 5 restarts within 5 cycles then exec "do_sms"

--
View this message in context: 
http://www.nabble.com/stop-restarting-and-exec-other-script-at-same-time-tp19360446p19360446.html
Sent from the monit-general mailing list archive at Nabble.com.



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





reply via email to

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