Reading time: 1 – 2 minutes
pip install superlance
Then it’s very easy to setup supervisord to send emails when a daemon changes the state because of a crash or something else.
Lines to add to supervisord configuration file:
command=/usr/local/bin/crashmail -a -m email@example.com
if you want to send notifications only for some applications:
command=/usr/local/bin/crashmail -p program1 -p group1:program2 -m firstname.lastname@example.org
Of course, superlance can listen many different event signals from supervisor and can take different actions like call to HTTP URL or send SMS. I want to recommend you to take look to the package documentation it could be useful to understand all the superlance power.