Possible to disable alerting

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Possible to disable alerting

David Jones
Is it possible to disable alerting for a single check?  For example, I have a check to watch for a timestamp of a folder to change to take some action but it's not really a problem.  I don't want monit sending an alert back to M/monit or show red/critical in this case but simply restart a process.

Thanks in advance,
Dave

--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general
Reply | Threaded
Open this post in threaded view
|

Re: Possible to disable alerting

Jan-Henrik Haukeland


> On 17 Jul 2019, at 00:00, David Jones <[hidden email]> wrote:
>
> Is it possible to disable alerting for a single check?  For example, I have a check to watch for a timestamp of a folder to change to take some action but it's not really a problem.  

If you use Monit alerts, you can add a local alert filter like so to filter out timestamp events, same for other events

check directory tmp with path /tmp/
    if changed timestamp then exec “/restart/some/process.sh"
    alert [hidden email] not on { timestamp }


> I don't want monit sending an alert back to M/monit or show red/critical in this case but simply restart a process.

Monit will still send the change event to M/Monit, that can’t be suppressed. If you use the 'if changed’ type check, M/Monit will first show orange for the status, but unless the timestamp was changed, it will show green on next report from Monit. If you use M/Monit for alerts (recommended and then the alert statement above can be removed) you can set it up to not alert on timestamp.

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