[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Is it possible to "alert" based on a cron-style string?
From: |
Martin Pala |
Subject: |
Re: Is it possible to "alert" based on a cron-style string? |
Date: |
Thu, 29 Jan 2015 18:38:19 +0100 |
Hello Marcus,
there is no support for cron-style alert filter currently, but it could be
certainly useful and we may add it in the future.
I think the workaround with two checks will work, another solution could be to
use "exec" action with custom script, which will send mail (using for example
"mail" CLI utility) only if the current time matches some pattern, something
like this:
check ...
if failed ... then exec "/usr/local/bin/myalert.sh"
Monit sets environment variables which you can use in the script to get details
about the event: http://mmonit.com/monit/documentation/monit.html#ENVIRONMENT
Regards,
Martin
> On 23 Jan 2015, at 10:12, Marcus Mülbüsch <address@hidden> wrote:
>
> Hello list,
>
> I have checks that I don't want go get an alert mail if it triggers and
> thus fill my mailbox. Setting "noalert address@hidden" works.
>
> However, at night and at weekends I'd like to get an alert mail. Right now
> I can only think of setting up to checks, one with "EVERY [cron]" and sending
> mail and the other with "NOT EVERY [cron]" and not sending mail.
>
> It is possible that way, but doubles the number of entries and thus is hard
> to maintain. Is it possible to apply a cron-style setting to just the alert
> statement, either globally or per check?
>
> Thank you,
>
> Marcus
>
>
>
> --
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general