monit-general
[Top][All Lists]
Advanced

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

Re: Skip x cycles after restart


From: Callum Macdonald
Subject: Re: Skip x cycles after restart
Date: Thu, 07 Feb 2013 12:25:53 +0700

This will also have the side effect that it'll take 50 seconds for the
HTTP check to fail, so if the HTTP server goes down, it'll be 50 seconds
before it's restarted.

Also, I'm not actually sure that if the server is not responding to port
80, that a 50 second timeout will let it respond 49 seconds later. I'm
guessing monit will report a "cannot connect" error immediately.

In short, I'm not sure that this approach will work on either side.

I asked a similar question recently, I wanted to "time out" for a
period. So if 3 restarts in 3 cycles, timeout for 15 cycles. But I
wasn't able to find a way to do that within monit itself.

It's highly inelegant, but you could set a start delay in monit and then
do something like this:
if failed host localhost port 8080 with proto http then exec
'/usr/bin/restart-http; service monit restart'

That would have the effect of restarting the entire monit system, the
start timeout would kick in, and all your services would be unmonitored
for X cycles or seconds. It's not pretty, but it might work.

Best of luck. Please let us know if you find a more elegant
solution. :-)

Cheers - Callum.

On Thu, 2013-02-07 at 09:23 +0530, Prajwal Manjunath wrote:
> You can try adding a larger timeout to the port statement. If your
> service takes 40 seconds to restart, you can give a timeout like 50
> secs:
> 
> if failed host localhost port 8080 with proto http with timeout 50
> seconds then restart
> 
> 
> 
> On Thu, Feb 7, 2013 at 3:10 AM, Stefan Catargiu
> <address@hidden> wrote:
>         Hello,
>         
>         
>         
>         
>         Is there a possibility to skip some monitoring cycles after a
>         process is restarted?
>         I know that for slow starting processes I can use a "every x
>         cycles" statement, but that's not really what I want, because
>         that means the checks will get further apart. 
>         
>         
>         What I am looking for is something like, "if failed host
>         localhost port 8080 with proto http then restart", but after
>         this restart, because the process takes a long time to be
>         responsive again, I would like monit to skip it a number of
>         seconds or an x number of cycles. 
>         Is something like this possible?
>         
>         
>         Thanks!
>         
>         
>         Regards,
>         Stefan
>         
>         --
>         To unsubscribe:
>         https://lists.nongnu.org/mailman/listinfo/monit-general
> 
> 
> --
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general





reply via email to

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