Hi Roger, This stuff looks like a good addition, thanks for the patch!
I wonder if I could tweak you into supplying a documentation patch too (there are Sphinx restructuredtext docs in the "docs" dir these days for each helper). Eventually these will make it on to supervisord.org. It also looks like you shadowed the existing tests.py file with a tests package. Or.. wait.. sorry.. it's not a package, just a directory. How the tests you added meant to be run? It would be nice if they were run when you did "setup.py test" (otherwise they probably won't get run). - C On Wed, 2010-07-28 at 15:25 -0700, Roger Hoover wrote: > Hi Chris, > > > Will you consider incorporating a patch for a couple new event > listeners into superlance? Originally I wanted to use crashmail but > found that it didn't meet our needs in the following ways: > > > 1) Alerts are not batched. We run hundreds of daemons under > supervisord and there are times (such as a DB issue) where all of them > may die unexpectedly in a short period of time. Sending an individual > email per event is WAY too many alerts. > > > 2) Emails are sent by forking, which is very CPU intensive. In our > environment, CPU is already at a premium during times when alerts are > being generated. We don't want alerting to aggravate the issue. > > > Initially, I tried to modify crashmail to incorporate batching but > found it made the options and the logic too convoluted so I decided to > create a new event listener called crashmailbatch.py (see summary > below). Similarly, we want alerts when a process fails to start or > restart and goes FATAL so I created a fatalmailbatch.py which behaves > almost identically. > > > I've attached a patch or you can grab the changes from the svn repo > clone I created on github (http://github.com/theduderog/Superlance) > > > Cheers, > > > Roger > > > > > crashmailbatch.py [--interval=<batch interval in minutes>] > [--toEmail=<email address>] > [--fromEmail=<email address>] > [--subject=<email subject>] > > > Options: > > > --interval - batch cycle length (in minutes). The default is 1 > minute. > This means that all events in each cycle are batched > together > and sent as a single email > > --toEmail - the email address to send alerts to > > > --fromEmail - the email address to send alerts from > > > --subject - the email subject line > > > A sample invocation: > > > crashmailbatch.py --toEmail="[email protected]" --fromEmail="[email protected]" > > > > > _______________________________________________ > Supervisor-users mailing list > [email protected] > http://lists.supervisord.org/mailman/listinfo/supervisor-users _______________________________________________ Supervisor-users mailing list [email protected] http://lists.supervisord.org/mailman/listinfo/supervisor-users
