monit-general
[Top][All Lists]
Advanced

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

Re: How to suppress monit alert if restart is successful?


From: Martin Pala
Subject: Re: How to suppress monit alert if restart is successful?
Date: Fri, 9 May 2014 01:00:25 +0200

Hi,

you can filter out the "nonexist" event like this:

        set alert address@hidden but not on { nonexist }

You will receive all other alert types, including the execution failure.

Regards,
Martin



On 06 May 2014, at 07:28, John Mee <address@hidden> wrote:

> Hi,
> 
> We only want to be alerted if the service fails to restart. Is this possible?
> 
> That is, if on the first check the service is down then restart it but don't 
> bother to send us an alert; if the service is still down two cycles in a row 
> - the restart failed - then we need to know about that so send an alert.
> 
> I tried if not exist for 2 cycles then alert but found that whilst we'd get 
> an alert it would not try to restart.
> 
> Tried it again with the below but same result: it sends an alert without 
> attempting to restart.
> 
> check process mysql with pidfile /var/run/mysqld/mysqld.pid
>    start program = "/etc/init.d/mysql start"
>    stop program = "/etc/init.d/mysql stop"
>    if not exist then restart
>    if not exist for 2 cycles then alert
> 
> Can we set it to only send the alert when pain persists?
> 
> 
> Thanks,
> John.
> 
> 
> 
> --
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general




reply via email to

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