monit-general
[Top][All Lists]
Advanced

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

Re: FW: Error in reminder keyword


From: Martin Pala
Subject: Re: FW: Error in reminder keyword
Date: Fri, 18 Nov 2005 15:53:02 +0100
User-agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)

Rishikesh Dongre wrote:
I was looking into this keyword because i want to see if it is feasible to 
perform multiple time step/threshold reminders.
> What I mean by that is for example when it is 85%, it would remind every four hours, when it is 90%, it would be every hour > and when it is 92% every 15 minutes, and when over 95%, every five minutes. And it should not send all reminders at same time.

Please suggest.


Every testing rule is standalone, even if it tests the same service property. If you define several error levels, such as:

 1. if space usage > 75% then ...
 2. if space usage > 85% then ...
 3. if space usage > 90% then ...
 4. if space usage > 92% then ...

then monit compares the space usage four times and do the appropriate action related to all given testing rules which match the condition. Each testing rule maintains its own state. Monit doesn't group these testing rules - if the usage is for example 87%, then rules 1+2 match and their reminder is applied independently.

With current monit version, there is probably the (complex) workaround - example:
--8<--
 check device datafs-75 with path /dev/sda5
   if space usage > 75% then alert
   alert address@hidden with reminder on 100 cycles

 check device datafs-85 with path /dev/sda5
   if space usage > 85% then exec "monit unmonitor datafs-75"
     else if passed then exec "monit monitor datafs-75"
   alert address@hidden with reminder on 50 cycles

 check device datafs-90 with path /dev/sda5
   if space usage > 90% then exec "monit unmonitor datafs-85"
     else if passed then exec "monit monitor datafs-85"
   alert address@hidden with reminder on 5 cycles
--8<--
Each error level is defined in its own service container. As the error level increases, the lower levels monitoring is disabled. When the space usage decrease, the lower level monitoring is enabled again.


More complex rules with common state and multiple error levels are not supported currently. It can be implemented in the future if people agree (volunteers are welcomed ;)

Possible syntax:

--8<--
 if space usage
  > 75%     then ...
  > 85%     then ...
  > 90%     then ...
  > 92%     then ...
  recovered then ...   # note: equals <=75%
--8<--

or

--8<--
 if space usage > 75%     then ...
 else if        > 85%     then ...
 else if        > 90%     then ...
 else if        > 92%     then ...
 else if        recovered then ...
--8<--



Martin








reply via email to

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