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

Runtime

= 0.4.2
 Project Readme

Sensu plugin for monitoring MySQL

A sensu plugin to monitor MySQL, including slave replication.

The plugin generates multiple OK/WARN/CRIT/UNKNOWN events via the sensu client socket (https://sensuapp.org/docs/latest/clients#client-socket-input).

What is currently supported:

  • Active connections check
  • Max used connections check
  • Slave IO/SQL threads running checks
  • Slave replication lag check
  • Uptime check
  • Operational check (up/down)

Usage

The plugin accepts the following command line options:

    -c, --config <PATH>              Optional configuration file (default: ./mysql.json)
        --crit-conn <PERCENTAGE>     Critical if PERCENTAGE exceeds the current number of open connections in relation to max connections (default: 90)
        --crit-slave-lag <SECONDS>   Critical if SECONDS exceeds the current slave replication lag (default: 120)
        --dryrun                     Do not send events to sensu client socket
        --handlers <HANDLER>         Comma separated list of handlers
    -H, --host <HOST>                MySQL host (default: localhost)
        --password <PASSWORD>        MySQL password
    -p, --port <PORT>                MySQL port (default: 3306)
        --uptime <UPTIME>            Uptime in seconds
    -u, --user <USER>                MySQL user
        --warn-conn <PERCENTAGE>     Warn if PERCENTAGE exceeds the current number of open connections in relation to max connections (default: 80)
        --warn-slave-lag <SECONDS>   Warn if SECONDS exceeds the current slave replication lag (default: 60)

For security reasons, it's recommended you placed the MySQL credentials in the JSON configuration file as follows:

{
  "username": "sensu",
  "password": "secret"
}

Author

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