[Top][All Lists]

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

Re: monit alerts with exec

From: Martin Pala
Subject: Re: monit alerts with exec
Date: Tue, 24 Mar 2015 13:10:47 +0100


the native alert action sends the alert on state change only (the reminder option may send alert again if the problem persists).

The exec action is executed each time the test failed, as monit delegates full responsibility for the event processing to the script and cannot assume the script is to be executed on state change only. You can modify your script to handle state change only (monit provides set of environment variables to the script: or you can use M/Monit ( as Monit extension, which has better alert rules support (including custom alert scripts execution on state change).


On 23 Mar 2015, at 21:24, Rubin, Alan <address@hidden> wrote:

This works including the reminder for /testfs.

However, the srvstat_mail  script seems to run fine but continues and emails the output every minute.

I am very new to monit so my code will need some improvements.  Hopefully you can help me clean this up.









set alert myemail with reminder on 5 cycles   #receive all alerts




check filesystem [/testfs] with path /dev/fslv00

if space usage > 90% for 1 times within 5 cycles then exec "/opt/monit/bin/srvstat_mail"





srvstat_mail calls another script > srvstat which is sent to a file srvstat.out > which I cat contents and email.


Alan Rubin
Sr. Systems Administrator
Sappi North America
179 John Roberts Road | South Portland, ME | 04106
Tel +1 207 854 7443 | Mobile +1 207 347 0978 | Fax +1   
address@hidden |
Paper is a sustainable and renewable source. Please recycle all printed documents. Paper informs, inspires and protects.

This message may contain information which is private, privileged or confidential and is intended solely for the use of the individual or entity named in the message. If you are not the intended recipient of this message, please notify the sender thereof and destroy / delete the message. Neither the sender nor Sappi Limited (including its subsidiaries and associated companies) shall incur any liability resulting directly or indirectly from accessing any of the attached files which may contain a virus or the like.

To unsubscribe:

reply via email to

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