[Top][All Lists]

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

Re: [monit] How to Reset Monit's Cycle Counters?

From: Martin Pala
Subject: Re: [monit] How to Reset Monit's Cycle Counters?
Date: Thu, 3 Jul 2008 22:43:47 +0200


i have modified the stop and unmonitor actions to cleanup the event state. You can get the source code from CVS:



On Jul 2, 2008, at 3:32 AM, Art Age Software wrote:

I have a service that looks something like this:

check file some-file with path /var/run/check.tmp
 start program = "/bin/touch /var/run/check.tmp"
 mode manual
 every 2 cycles
if changed timestamp 5 times within 10 cycles then exec "/some/ script"
 if 10 restarts within 20 cycles then timeout

I would like to find some way of resetting monit's check on the
timestamp after the exec "/some/script" occurs. Currently, exec
"/some/script" (indirectly) invokes "monit unmonitor some-file"
(through heartbeat). However, when monitoring is re-enabled on
some-file in the future, monit will treat an immediate  occurrence of
a changed timestamp as being within the window of "5 times within 10
cycles" which causes it to immediately invoke "/some/script" again. In
my case, "/some/script" is a heartbeat failover command, so the
unfortunate effect is that the two nodes just ping-pong the services
back and forth between them every minute.

I have tried restarting the some-file service (as opposed to
unmonitor/monitor), which also does not work.

So far, the only thing that seems to work is to force a "monit reload".

Is there any other way?

To unsubscribe:

reply via email to

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