Jan-Henrik Haukeland wrote:

On 22. jan. 2006, at 14.20, Christian Kowarzik wrote:

i do icmp checks with monit.
during failure of the destination host monit will alert me once but execute the exec-action every cycle. how can i configure monit, so that it will execute the exec-action only once the destination host goes down like it does with the alert-mail?


You can't, monit will always execute the associated action when an if- test fails. It makes sense for a process, but in this case I can see your point. On the other hand, if the exec-script you call out to could fix the problem, you would probably like monit to call it more than once. Let's hear what Martin thinks first.

Maybe we can add generic 'retry' argument to the action to set the count of actions performed when the service remains in the same state. Something like:

  if failed then <action1> [retry <x> [times]]
  [else if passed then <action2> [retry <y> [times]]]


Current default monit behavior is:

- when failed, perform the action each cycle (alert action is special - it is tried only once unless overriden by the 'reminder' option)

 - when passed, the action is tried only once


=> proposal:

- add the 'retry' option to the <action> (value of -1 means no limits)
- try the action only once by default (even in the case of failed state)


What do you think?

Martin













--
To unsubscribe:
http://lists.nongnu.org/mailman/listinfo/monit-general

Reply via email to