monit-general
[Top][All Lists]
Advanced

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

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


From: Art Age Software
Subject: [monit] How to Reset Monit's Cycle Counters?
Date: Tue, 1 Jul 2008 18:32:39 -0700

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?




reply via email to

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