Skip to main content

A Supervisor event listener for Riemann

Project description

http://img.shields.io/pypi/v/supermann.svg http://img.shields.io/pypi/l/supermann.svg http://img.shields.io/travis/borntyping/supermann/master.svg

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.

Changelog

Version 3.0.0

  • Upgraded to most recent version of psutil (2.1.1)

  • Replaced or changed various metrics

  • Replaced argparse with click and made improvements to CLI

  • Replaced @file argument syntax with supermann-from-file

  • Removed --memmon option and memory monitoring plugin

  • Added documentation on Read the Docs

  • Many other minor fixes and improvements

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.

Authors

Supermann was written by Sam Clements, while working at DataSift.

https://0.gravatar.com/avatar/8dd5661684a7385fe723b7e7588e91ee?d=https%3A%2F%2Fidenticons.github.com%2Fe83ef7586374403a328e175927b98cac.png&r=x&s=40 https://1.gravatar.com/avatar/a3a6d949b43b6b880ffb3e277a65f49d?d=https%3A%2F%2Fidenticons.github.com%2F065affbc170e2511eeacb3bd0e975ec1.png&r=x&s=40

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

supermann-3.2.0.tar.gz (13.0 kB view details)

Uploaded Source

Built Distribution

supermann-3.2.0-py2-none-any.whl (15.7 kB view details)

Uploaded Python 2

File details

Details for the file supermann-3.2.0.tar.gz.

File metadata

  • Download URL: supermann-3.2.0.tar.gz
  • Upload date:
  • Size: 13.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for supermann-3.2.0.tar.gz
Algorithm Hash digest
SHA256 b2d159bcb9d680d060fa44ac513b12b3e59540d21046b055e10b5978051d203e
MD5 37781f50ded0f6578e834fca6617dc56
BLAKE2b-256 b6e1a4f1c34f56037c8db42bef2abab6fb5ffb954a826a2eb52603677b0ca826

See more details on using hashes here.

File details

Details for the file supermann-3.2.0-py2-none-any.whl.

File metadata

File hashes

Hashes for supermann-3.2.0-py2-none-any.whl
Algorithm Hash digest
SHA256 996d8a008d68d2d33cd1b2db807895c92a3204323ef6522b4df7722df05601e9
MD5 20e4d1edf0e135785da9e5b6af8648cf
BLAKE2b-256 9a63cd64c59da26b3fc4d861ad7fb4d329f6e3716e667bda2803dfdf6669383b

See more details on using hashes here.

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