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:
http://lists.nongnu.org/mailman/listinfo/monit-general