Receive notifications for supervisor process events
Project description
supervisor-alert
Are you using Supervisor to manage processes on a server? With supervisor-alert you can receive messages when the state of your processes change. Be the first to know when your services die!
To send messages on Telegram you need to install and set up telegram-send first. You can also use any shell command to send the notifications.
Installation
Install supervisor-alert on your system:
sudo pip install supervisor-alert
Then create the file /etc/supervisor/conf.d/supervisor_alert.conf as root:
[eventlistener:supervisor_alert]
command=supervisor-alert --telegram
events=PROCESS_STATE_RUNNING,PROCESS_STATE_EXITED,PROCESS_STATE_FATAL
autostart=true
autorestart=true
user=supervisor_alert
This will send the notifications over Telegram, to use something else, for example ntfy, pass in the command:
command=supervisor-alert -c 'ntfy send'
This configuration will run the event listener as the user supervisor_alert. It is a good practice to isolate services by running them as separate users (and avoiding running them as root). Add the user with:
sudo adduser supervisor_alert --system --no-create-home
Optionally, you can also subscribe to different supervisor events, look at the docs to see on which ones you’d like to be notified.
Finally, load the config and start the event listener:
sudo supervisorctl reread
sudo supervisorctl update
You should now receive your first alert, notifying you that supervisor_alert has started running.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for supervisor_alert-0.2.1-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4fa8cc838b746b76a34ad5be732b40bc67a1f463dc91e1974a9746eeacde0b42 |
|
MD5 | b5f99c85149d3fdd2297454a3d730ec7 |
|
BLAKE2b-256 | cc625621e17d627ced3429c00faf7d5baf79d5f5e398c4c54da285f40b0ef298 |