monit-general
[Top][All Lists]
Advanced

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

Re: Alerting techniques


From: Randy Ramsdell
Subject: Re: Alerting techniques
Date: Mon, 15 Nov 2010 15:42:03 -0500
User-agent: Thunderbird 2.0.0.24 (X11/20100228)

Randy Ramsdell wrote:
We are trying to use monit to alert after an initial timeout period. The purpose is to ONLY alert if the service does not start up of has continual failures.

Our current alerts are sent via email because I cannot find a way to set this up and I have read the documentation several times trying to solve this issue.

An example configuration:

alert address@hidden

if failed host localhost port 81 send "POST / HTTP/1.1\r\nHost: zp4\r\nUser-Agent: Mozilla/4.0\r\nContent-Length: 27\r\nContent-xxType: application/x-www-form-urlencoded\r\n\r\naddress=1817 NW 10TH Street&zip=33445" expect "ZP4" then exec "/opt/systems/database/zp4/scripts/zp4_restart.sh PROD01"
        if failed port 82 for 2 times within 5 cycles then alert

This will not alert if I remove the alert setting, but will alert of first change if I enable that line.

We do not want to be alerted on initial failure, but only if the restart does not fix it after a defined period of time.

How do we configure this type of alerting?

Thanks,
RCR

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


Replying to myself. In in the second "If failed", I used port 82, which was a typo but, it does not a difference. I read through the documents again and it appears impossible to do what we need. Since we cannot send an alert on {exec,alert} and have no way to selectively alert, I thought I would simply add a solution that may be included in the future.

All we need in the above is to have a additional parameter which will only alert when the check fails 10 times.

Change this:

If if failed host localhost port 81 send "POST $some_txt" expect "$some_txt" then exec "$a_script"

To this:
If if failed host localhost port 81 send "POST $some_txt" expect "$some_txt" then exec "$a_script" AND alert if failed $NUM times within $NUM cycles with reminder on $NUM cycles.

Problem solved and I think logical to boot.

Thanks,
RCR



reply via email to

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