Is there any way supervisord
can automatically restart a failed/exited/terminated job and send me a notification email with a dump of the last x lines of log file?
Is there any way supervisord
can automatically restart a failed/exited/terminated job and send me a notification email with a dump of the last x lines of log file?
There is a plugin called superlance.
You install it with
pip install superlance
or download it at: http://pypi.python.org/pypi/superlanceThe next thing you do is you go into your
supervisord.conf
and add the following lines:This should be followed by a "supervisorctl update". When a process "exits" you will now get a notification sent to [email protected].
If you only want to listen to some selected apps you can exchange the
-a
for a-p program1
or if it is a groupgroup1:program2
One example would beRegarding the automatic restart: you should make sure that
autorestart
is set totrue
(it is set tounexpected
by default). This way the package will be restarted 3 times. If after that it still exits, it gives up, but you can change that withstartretries
.Example program:
I tried installing superlance and running crashmail like this:
after i do:
and after i added:
and I do not receive anything....
My crashmail file is: