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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 2

Supported by

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