monit-general
[Top][All Lists]
Advanced

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

Re: noalert for specific if statement in service check


From: Martin Pala
Subject: Re: noalert for specific if statement in service check
Date: Tue, 27 Nov 2012 21:43:41 +0100

Yes, the "noalert" cannot be used in the test context - it is valid for the 
whole check. You can filter out specific event types by type (using "not on { 
events_list }") but not based on specific value. In your case you can use the 
exec action which can be used to send alerts on per-test level:

--8<--
check filesystem data with path /dev/sdb
    if space usage > 90% for 5 times within 15 cycles then exec "/usr/bin/mail 
-s filesystem_data_full address@hidden"
    if space usage > 95% then exec "/usr/bin/mail -s filesystem_data_full 
address@hidden address@hidden"
--8<--

or create custom script where you can use MONIT_* environment variables to read 
the event context and process it accordingly (send alerts, etc.) 

Regards,
Martin


On Nov 26, 2012, at 10:17 PM, Britt Treece <address@hidden> wrote:

> I have two set alert emails in the global section of my config 
> 
> set alert address@hidden
> set alert address@hidden
> 
> I would like usera to get all alerts and userb to only get some alerts.  
> Specifically I would like userb to only get alerts for filesystem space usage 
> if it's over 95%. I tried the following configuration for the filesystem 
> check but the noalert statement appears to function only for the check not 
> for a specific if test
> 
>   check filesystem data with path /dev/sdb
>     if space usage > 90% for 5 times within 15 cycles then alert
>       noalert address@hidden
>     if space usage > 95% then alert
> 
> Is there a correct way to configure this?  I am using monit 5.4.1.
> 
> Thanks,
> 
> Britt Treece
> --
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general




reply via email to

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