Skip to content
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.
/ superslacker Public archive
forked from slara/superslacker

Supervisord event listener that will send alerts to Slack heavily based on superlance

License

Notifications You must be signed in to change notification settings

Contexte/superslacker

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Superslacker

Superslacker is a supervisor "event listener" that sends events from processes that run under supervisor to Slack. When superslacker receives an event, it sends a message notification to a configured Slack channel.

superslacker uses Slacker full-featured Python interface for the Slack API.

Installation

pip install superslacker

Command-Line Syntax

$ superslacker [-t token] [-c channel] [-n hostname] [-w webhook] [-a attachment] [-e events]

Options

-t TOKEN, --token=TOKEN

Post a message to Slack using Slack Web API. In order to be able to send messages to Slack, you need to generate your token by registering your application. More info can be found here

-c CHANNEL, --channel=CHANNEL

#channel to fill with your crash messages.

-n HOSTNAME, --hostname=HOSTNAME

Name or identificator of the machine where the events are been generated. This goes in the event message.

-w WEBHOOK, --webhook=WEBHOOK

Post a message to Slack using Slack Incoming WebHook. In order to be able to send messages to Slack, you need to configure an Incoming WebHook for your Slack account. More info can be found here

-e EVENTS, --event=EVENTS

The Supervisor Process State event(s) to listen for. It can be any, one of, or all of STARTING, RUNNING, BACKOFF, STOPPING, EXITED, STOPPED, UNKNOWN.

-i ICON_EMOJI, --icon=ICON_EMOJI

To customize the Slackmoji to be used as icon. Defaults to :sos:.

-u USERNAME, --username=USERNAME

To customize the Slack username. Defaults to superslacker.

Notes

👻 gonna be used as an icon for the message and superslacker as a username.

Configuration

An [eventlistener:x] section must be placed in supervisord.conf in order for superslacker to do its work. See the “Events” chapter in the Supervisor manual for more information about event listeners.

The following example assume that superslacker is on your system PATH.

[eventlistener:superslacker]
command=superslacker --token="slacktoken-slacktoken-slacktoken" --channel="#notifications" --hostname="HOST" --events="UNKNOWN,STOPPING"
events=PROCESS_STATE,TICK_60

About

Supervisord event listener that will send alerts to Slack heavily based on superlance

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%