A Supervisor event listener for Riemann
Project description
Supermann monitors processes running under Supervisor and sends metrics to Riemann.
Usage
Supermann runs as a Supervisor event listener, and will send metrics every time an event is received. The only configuration Supermann needs is the host and port for a Riemann instance, which can be provided as arguments or by the RIEMANN_HOST and RIEMANN_PORT environment variables.
Basic usage is as follows, though Supermann will not start if not run under Supervisor:
supermann [--log-level=LEVEL] HOST PORT
A Supervisor configuration file for Supermann should look something like this:
[eventlistener:supermann] command=supermann-from-file /etc/supermann.args events=PROCESS_STATE,TICK_5
This loads Supermann’s arguments from /etc/supermann.args, which would contain a host and port for a Riemann server - localhost:5555 is used as the default if no host or port are specified:
riemann.example.com 5555
What Supermann does
Supermann will collect and send information about the system and the processes running under Supervisor each time an event is received. Listening for the TICK_5 and PROCESS_STATE events will collect and send information every 5 seconds, and when a program changes state. See the Supervisor event documentation for more information.
Supermann is designed to bail out when an error is encountered, allowing Supervisor to restart it - it is recommended that you do not set autorestart=false in the Supervisor configuration for the event listener. Logs are sent to STDERR for collection by Supervisor - the log level can be controlled with the --log-level argument. The logs can be read with supervisorctl tail supermann stderr or finding the log in Supervisor’s log directory.
supermann-from-file
An issue with modifying the configuration of a Supervisord event listener (link) means that the command used to start an event listener process can’t be changed while Supervisord is running.
Supermann 2 allowed files to be named directly as an argument that more arguments would be read from. Supermann 3 instead provides the supermann-from-file entry point, which loads a file containing arguments that will be passed to the main supermann command.
The easiest way to upgrade between versions is to rename the eventlistener:supermann section in the Supervisord configuration, and to then run supervisorctl update. This will remove the old supermann instance, and start a new instance with the new command. The supermann-from-file command reads a set of arguments from a file and starts Supermann with those arguments, so that Supermann’s configuration can be changed without restarting Supervisord.
Installation
Supermann can be installed with pip install supermann. It’s recommended to install it in the same Python environment as Supervisor.
Supervisor can also be installed with pip, or can be installed from your distributions package manager. Once Supermann is installed, add an eventlistener section to the Supervisor configuration (/etc/supervisord.conf by default) and restart Supervisor.
Requirements
The psutil package uses C extensions, and installing the package from source or with a python package manager (such as pip) will require build tools. Alternatively, it can be installed from your distribution’s repositories (python-psutil on Debian and CentOS). Superman currently uses a very old version of psutil so as to remain compatible with CentOS.
Supermann is developed and tested on Python 2.6. There are no plans to release it for Python 3, as Google’s protobuf library (and therefore riemann-client) are only compatible with Python 2.
Licence
Supermann is licensed under the MIT Licence. The protocol buffer definition is sourced from the Riemann Java client, which is licensed under the Apache Licence.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file supermann-3.0.0.tar.gz
.
File metadata
- Download URL: supermann-3.0.0.tar.gz
- Upload date:
- Size: 12.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f86c003b780518e8cc03f8b64839af8a19656f58e93e6e56fd8103a94be3f04 |
|
MD5 | db432c4266f00a870c3d043841d98e29 |
|
BLAKE2b-256 | 5c2bd526b22a32200427f7f974194d03f70e8671e5dc2f2f30df9bb51edb2687 |
File details
Details for the file supermann-3.0.0-py2-none-any.whl
.
File metadata
- Download URL: supermann-3.0.0-py2-none-any.whl
- Upload date:
- Size: 24.7 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 782b7fb707f8181715c9f12bb5b6ddf87e334b33c8dcd0fa0b50431607102d5b |
|
MD5 | b7f3772ff727b86150df1ff1c2171ce4 |
|
BLAKE2b-256 | 472361c51d65012a527fe944eb4fe8c5fabbcc0e28b4cca0dd30dcb2dbd0c4b4 |