mtyurt / supervisor-event-to-slack

A small tool to send supervisor events to Slack
BSD 3-Clause "New" or "Revised" License
8 stars 1 forks source link
event-handler go slack supervisor

supervisor-event-to-slack

This showcase repository listens to supervisor events and sends these events to Slack properly. Generic supervisor-event-handler is used to process supervisor events.

installation

git clone git@github.com:mtyurt/supervisor-event-to-slack
cd supervisor-event-to-slack
vgo build

usage

This program needs to be provided to supervisor configuration as event listener. A bare minimum configuration would be:

$ cat > eventlistener.ini <<EOF
[eventlistener:status_listener]
command=/path/to/supervisor-event-to-slack
events=PROCESS_STATE
autostart=true
environment=SLACK_TOKEN="your-slack-token",SLACK_CHANNNEL="channel-to-post-messages"
EOF

Copy this file to supervisor.d config directory, by default /etc/supervisor.d/, and restart supervisord.

Check out http://supervisord.org/events.html for event types and their payloads.

troubleshooting

licence

The BSD 3-Clause License - see LICENSE for more details.