Metadata-Version: 2.1
Name: superslacker
Version: 0.9.1
Summary: superslacker plugin for supervisord
Home-page: https://github.com/MTSolutions/superslacker
Author: Sebastian Lara Menares
Author-email: slaramen@gmail.com
Maintainer: Sebastian Lara Menares
Maintainer-email: slaramen@gmail.com
License: BSD-derived (http://www.repoze.org/LICENSE.txt)
Keywords: supervisor slack monitoring
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: No Input/Output (Daemon)
Classifier: Intended Audience :: System Administrators
Classifier: Natural Language :: English
Classifier: Operating System :: POSIX
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.2
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Topic :: System :: Boot
Classifier: Topic :: System :: Monitoring
Classifier: Topic :: System :: Systems Administration
License-File: LICENSE.txt

# Superslacker

Superslacker is a supervisor "event listener" that sends events from processes that run under [supervisor](http://supervisord.org) to [Slack](https://slack.com). When `superslacker` receives an event, it sends a message notification to a configured `Slack` channel.

`superslacker` uses [Slacker](https://github.com/os/slacker) full-featured Python interface for the Slack API.

## Installation

```
pip install superslacker
```

## Command-Line Syntax

```bash
$ superslacker [-t token] [-c channel] [-n hostname] [-w webhook] [-a attachment] [-e events] [-p proxy] [--eventname eventname] [--interval interval] [--blacklist apps] [--whitelist apps]
```

### 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](https://api.slack.com/web)

```-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](https://api.slack.com/incoming-webhooks)

```-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.

```-p PROXY, --proxy=PROXY```

If you server with supervisord is behind proxy

```-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`.

```-eventname=EVENTNAME```

How often to check changes. TICK_5 or TICK_60. Default TICK_60.

```--interval=INTERVAL```

How often to flush message queue. Default 60 sec.

```--blacklist=apps```

List of applications to ignore (support keyword "ALL")

```--whitelist=apps```

List of applications always to monitor with all events (support keyword "ALL". Take priority over blacklist)




## Notes

:ghost: 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
```



0.9.1 (2022-06-21)
------------------
Fix default values for eventname and interval

0.8 (2022-06-12)
----------------
Added whitelist functionality

0.7 (2022-06-12)
----------------
Added blacklist functionality

0.6 (2020-09-30)
----------------
Added additional parameters to pass into superlance (eventname and interval)

0.5 (2020-09-29)
----------------
Added proxy support
Changed format of messages (compact)

0.4 (2019-11-15)
----------------
Customize Slack username and icon. (Thanks to David Guillot)

0.3 (2018-09-01)
----------------
- Make events to watch configurable (Thanks to Ifiok Idiang @ifiok)


0.2 (2017-07-18)
----------------
- Add support for incoming webhooks (Thanks to Roman Zhuzha)

0.1 (2016-06-27)
----------------
- refactor

0.02 (2015-10-30)
-----------------
- Copyright and Package fixes.


0.01 (2015-10-30)
-----------------
- Initial release


