Skip to main content

Receive notifications for supervisor process events

Project description

supervisor-alert

License

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 run:

sudo supervisor-alert --configure

for the default configuration. This will send notifications over Telegram. Read the next section to customize or if you dislike automatic configurations.

Manual Configuration

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

supervisor-alert-0.3.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

supervisor_alert-0.3-py2-none-any.whl (6.2 kB view details)

Uploaded Python 2

File details

Details for the file supervisor-alert-0.3.tar.gz.

File metadata

File hashes

Hashes for supervisor-alert-0.3.tar.gz
Algorithm Hash digest
SHA256 1e967543251923a27cdae020a6bc252cab69b232640191f5882fd573902fdfc6
MD5 527657d74099a817121ee9a2caab9578
BLAKE2b-256 db2af8b76e7329331f67d46d4620561a107fba9d3c9d16bb50649c8cdafba1d6

See more details on using hashes here.

File details

Details for the file supervisor_alert-0.3-py2-none-any.whl.

File metadata

File hashes

Hashes for supervisor_alert-0.3-py2-none-any.whl
Algorithm Hash digest
SHA256 30b64b6bde2ba8f720e4c8b0997abc43be6ea5d88a2f3b81f97c11b499ccdf57
MD5 0d38ee2a627c1a003b656f1fc0551e31
BLAKE2b-256 c1b29d8ab76ae4b7f31b5827ee4333ad00842cdf73d7cee05a7f40905849f5f5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page