Ignore Monit's First Alert

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

Ignore Monit's First Alert

Rizal Muttaqin

Use case: Send alert after particular port down 5 times within 5 cycles, otherwise just ignore it. In other word, if particular port down less than 5 times within 5 cycles, don’t send any email.
>If particular port down continously, send alert every 5 cycles

Reality: Monit sent alert every first port down state.

Question: How to ignore first alert? Should email reminder set on 1 cycles or 5 cycles?

OS: CentOS 7

Monit version 5.14 from e17 epel repository

This is my monit configuration, the script basically contains a nmap command for double checking port status functionality.
#########################################################

set daemon 300 # 5 minutes per cycle
check host somehost with address somehost.com

start program = "/opt/monit/scripts/somehostcheckport.sh start"

stop program = "/opt/monit/scripts/somehostport.sh stop"

if failed port 80 then restart

if 5 restart within 5 cycles then alert

alert [hidden email] with reminder on 5 cycles


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

Re: Ignore Monit's First Alert

martinp@tildeslash.com
You can try this:

check host somehost with address somehost.com
start program = "/opt/monit/scripts/somehostcheckport.sh start"
stop program = "/opt/monit/scripts/somehostport.sh stop"
if failed port 80 for 5 cycles then restart # note: will restart the service if down for 5 consecutive cycles, the alert is implicit (send as part of the restart)
alert [hidden email] with reminder on 5 cycles

Best regards,
Martin


On 19 Sep 2017, at 08:41, Rizal Muttaqin <[hidden email]> wrote:


Use case: Send alert after particular port down 5 times within 5 cycles, otherwise just ignore it. In other word, if particular port down less than 5 times within 5 cycles, don’t send any email. 
>If particular port down continously, send alert every 5 cycles 

Reality: Monit sent alert every first port down state.

Question: How to ignore first alert? Should email reminder set on 1 cycles or 5 cycles?

OS: CentOS 7

Monit version 5.14 from e17 epel repository

This is my monit configuration, the script basically contains a nmap command for double checking port status functionality.
#########################################################

set daemon 300 # 5 minutes per cycle
check host somehost with address somehost.com

start program = "/opt/monit/scripts/somehostcheckport.sh start"

stop program = "/opt/monit/scripts/somehostport.sh stop"

if failed port 80 then restart

if 5 restart within 5 cycles then alert

alert [hidden email] with reminder on 5 cycles

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


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