No commit activity in last 3 years
No release in over 3 years
This plugin provides facilities for monitoring services running in Rancher
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

Sensu plugin for monitoring services running in Rancher

A sensu plugin to monitor the health state of services running in Rancher.

The plugin leverages the Sensu JIT clients feature (https://sensuapp.org/docs/latest/clients#jit-clients) to create a client for every Rancher service discovered. The client name is in the format: <stack_name>_<service_name>.rancher.internal.

It then generates for every instance (container) running in the service OK/WARN/CRIT/UNKNOWN events via the sensu client socket (https://sensuapp.org/docs/latest/clients#client-socket-input), reporting whether the instance is not monitored (WARN), healthy (OK) or unhealthy (CRITICAL).

You can optionally disable monitoring for a service by placing in the rancher-compose service metadata the following:

service:
  metadata:
    sensu:
      monitored: false

Usage

The plugin accepts the following command line options:

Usage: check-rancher-service.rb (options)
        --api-url <URL>              Rancher Metadata API URL (default: http://rancher-metadata/2015-07-25)
        --dryrun                     Do not send events to sensu client socket
        --handlers <HANDLERS>        Comma separated list of handlers
    -w, --warn                       Warn instead of throwing a critical failure

Use the --handlers command line option to specify which handlers you want to use for the generated events.

Deployment

In order to run this check, you might want to deploy a sensu-client running as a container in Rancher, acting as a "sensu proxy".

Author

Matteo Cerutti - matteo.cerutti@hotmail.co.uk