Perl-Sensitive Sunglasses | |
PerlMonks |
Re^3: Email Thresholdingby mr_mischief (Monsignor) |
on Apr 02, 2015 at 17:19 UTC ( [id://1122285]=note: print w/replies, xml ) | Need Help?? |
I would query the database with the time constraint of the last 60 minutes. If you're not timestamping your entries with a native DB timestamp, start doing that. I would consider how many varieties of alert I could have, and if that's three or four, I'd limit each type to one per hour rather than one overall. For auditability you're going to want a record of the emails being sent anyway. Have a table where you record the email being sent. Select any sent for your class of alert (or for all if you go that route) from the last hour, by timestamp. If there are none, aggregate all the events from the last hour which you selected above, send an email, and insert your row into the email_sent table. The more we discuss this, the more it sounds like Nagios, Mon, Argus, Big Brother, Tripwire, or some other monitoring/IDS solution. You might be able to make a plugin to one of those or at least look to them for how to solve these issues.
In Section
Seekers of Perl Wisdom
|
|