The exec action is executed any time the rule matches - if you need to execute 
it only once, you can handle it in the script. 

Regards,
Martin


On Nov 28, 2012, at 2:05 AM, Britt Treece <[email protected]> wrote:

> I wish it was capable of alerting separately for each test, but I think these 
> are both acceptable alternatives.
> 
> Is there a simple way to make it exec for a true test just once rather than 
> every time it tests true?
> 
> 
> On Tue, Nov 27, 2012 at 2:43 PM, Martin Pala <[email protected]> wrote:
> 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 usera@noreply"
>     if space usage > 95% then exec "/usr/bin/mail -s filesystem_data_full 
> usera@noreply userb@noreply"
> --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 <[email protected]> wrote:
> 
> > I have two set alert emails in the global section of my config
> >
> > set alert usera@noreply
> > set alert userb@noreply
> >
> > 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 userb@noreply
> >     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
> 
> 
> --
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general
> 
> --
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general

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

Reply via email to