monit-general
[Top][All Lists]
Advanced

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

Re: Another feature


From: Martin Pala
Subject: Re: Another feature
Date: Sun, 12 Sep 2010 19:15:53 +0200

Yes, the alert action implementation handles the notification so, that the 
alert is sent only on state changes (success->failure or failure->success). 
There is a 'reminder' option which allows to repeat the alert if the service 
remains in error, but by default it sends one alert only.

If you delegate the alert to script via exec action, it will be executed on 
every failure cycle (monit tries to recover the service and unless timeout 
statement is used, it calls the exec action each time). In order to reach the 
same alert-on-state-change functionality, you'll need to do it in the executed 
script.

Regards,
Martin


On Sep 11, 2010, at 9:02 PM, Andrew Holt wrote:

> Hi,
> 
> I am trying this:
> 
> check host acs1 with address acs1
>    if failed icmp type echo count 4 with timeout 15 seconds
>        then exec "/root/Scripts/alert.sh ping"
> 
> If I pull the ethernet connection to ascs1 then sure enough the script runs.
> 
> However, I get the message multiple times.  Does 'alert' do something like 
> set a fail flag against the monitored object, which it later clears when the 
> fault is rectified ?
> 
> 
> Thanks,
> Andrew
> 
> 
> 
> On 11 Sep 2010, at 13:49, Martin Pala wrote:
> 
>> Hi,
>> 
>> you can use exec action instead of alert:
>> 
>> check device root with path /
>>    if space usage > 89% then exec "/root/Scripts/alert.sh" else if succeeded 
>> then exec "/root/Scripts/alert.sh"
>> 
>> Upcoming M/Monit-2.3 also allows to set rules for events which allow to 
>> execute custom program (in addition to email and instant message). We use it 
>> to collect events from all monit hosts and pass the event to text-to-speach 
>> program so we can hear what happened if event arrives (in practice it is 
>> pretty cool :), it is also possible to execute snmptrap, etc.
>> 
>> Martin
>> 
>> 
>> On Sep 11, 2010, at 2:33 PM, Andrew Holt wrote:
>> 
>>> 
>>> Hi,
>>> 
>>> One other thing I would like to be able to do
>>> 
>>> e.g.
>>> 
>>> check device root with path /
>>>  if space usage > 89% then alert
>>>  else if succeeded then alert
>>> 
>>> And alert sends a mail.  What would be useful is
>>> 
>>> set alert_action exec "/root/Scripts/alert.sh"
>>> 
>>> Where the default is:
>>> 
>>> set alert_action email
>>> 
>>> 
>>> 
>>> =============================
>>> Andrew Holt
>>> 
>>> Email: address@hidden
>>> 
>>> De Omnibus Dubitandum
>>> =============================
>>> 
>>> 
>>> 
>>> 
>>> --
>>> To unsubscribe:
>>> http://lists.nongnu.org/mailman/listinfo/monit-general
>> 
>> 
>> --
>> To unsubscribe:
>> http://lists.nongnu.org/mailman/listinfo/monit-general
>> 
> 
> =============================
> Andrew Holt
> 
> Email: address@hidden
> 
> De Omnibus Dubitandum
> =============================
> 
> 
> 
> 
> --
> To unsubscribe:
> http://lists.nongnu.org/mailman/listinfo/monit-general




reply via email to

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