monit-general
[Top][All Lists]
Advanced

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

Re: can monit 5.2.5 execute a script when it times out?


From: Martin Pala
Subject: Re: can monit 5.2.5 execute a script when it times out?
Date: Thu, 9 Jun 2011 01:45:03 +0200

Unfortunately multiple actions in one statement are not supported now, you can use one of following workarounds:

1.) either call the unmonitor along with exec like this:

    if 5 restarts within 5 cycles the exec "/bin/bash -c '/path/to/cool/script && /usr/bin/monit unmonitor myservice'"


2.) or specify the timeout action in standalone timeout statement like this:

    if 5 restarts within 5 cycles the exec "..."
    if 5 restarts within 5 cycles the timeout


Regards,
Martin


On Jun 7, 2011, at 3:05 AM, Michael, Jason wrote:

I know I can do
 
If 5 restarts in 5 cycles then timeout
 
And also
 
If 5 restarts in 5 cycles then exec "/path/to/cool/script"
 
But I can't figure out how to do this:
 
If 5 restarts in 5 cycles then timeout and exec "/path/to/cool/script"
 
It seems like monit is the logical place to put cleanup scripts for when a process can't be restarted.  How can I do this?
 
TIA,
Jason
--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general


reply via email to

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