Reputation: 6907
Hey there, We have a setup in monit whereby we monitor a whole lot of log files for the string "Exception". When monit sees this string, we get an email alert.
There are times when we get spammed very heavily when our application hits the same exception many times.
One solution would be to be smarter around the way we log exceptions, but sometimes it's not always obvious where this type of "often-repeating" exception may occur, until it's too late and we've been spammed.
Was wondering if anyone knew of any method of throttling monit alerts. For example when the same exception occurs more than 5 times, stop alerting for a give period.
Any ideas would be appreciated.
Upvotes: 6
Views: 654
Reputation: 225
This was fixed in Monit 5.4:
Monit 5.4 or newer sends only one alert in the given cycle, changelog excerpt:
--8<-- * The content match test now sends one event per cycle and pattern. Even if there are multiple lines matching the same pattern, only one event will be generated. Also the event rate is fixed now, so it is possible to require match for X cycles before generating the event. --8<--
Systems with older packages might find an updated version in a third-party repo. e.g.:
http://apt.sw.be/redhat/el5/en/i386/dag/RPMS/monit-5.5-1.el5.rf.i386.rpm
Upvotes: 0