NAME

mysql_ - Munin plugin to display misc MySQL server status

APPLICABLE SYSTEMS

Any MySQL platform, tested by the authors on: * MySQL 5.0.51 * MariaDB 5.5.39 * MariaDB-5.5.39(galera). * MySQL 5.6.12 * MariaDB 10.0.18

Plugins: * MariaDB-10 Query Response Time: https://mariadb.com/kb/en/mariadb/query_response_time-plugin/

Information Schema tables: * User statistics - MariaDB-5.2+, OurDelta, Percona Server - https://mariadb.com/kb/en/mariadb/user-statistics

CONFIGURATION

This script is used to generate data for several graphs. To generate data for one specific graph, you need to create a symbolic link with a name like mysql_<GRAPH> to this script.

If you need to run against multiple MySQL instances on the same host, create your symlinks with names like mysql<N>_<GRAPH> where N is any non-negative integer. You must also set the env.cachenamespace variable to a unique value for each group of symlinks.

To get a list of symlinks that can be created, run:

  ./mysql_ suggest

In addition you might need to specify connection parameters in the plugin configuration to override the defaults. These are the defaults:

  [mysql_*]
    env.mysqlconnection DBI:mysql:information_schema
    env.mysqluser root

Non-default example:

  [mysql_*]
    env.mysqlconnection DBI:mysql:information_schema;host=127.0.0.1;port=3306
    env.mysqluser munin
    env.mysqlpassword geheim
    env.cachenamespace munin_mysql_pri
  [mysql2_*]
    env.mysqlconnection DBI:mysql:information_schema;host=127.0.0.1;port=13306
    env.mysqluser munin
    env.mysqlpassword ryuWyawEv
    env.cachenamespace munin_mysql_alt
  [mysql10_*]
    user munin
    env.mysqluser munin
    env.mysqlconnection DBI:mysql:information_schema;mysql_read_default_file=/etc/munin/.my-10.cnf
    env.cachenamespace munin_mysql_10
    # here the [client] section of /etc/munin/.my-10.cnf is read. socket= can
    # be specified here.

Creating a munin user:

  CREATE USER 'munin'@'localhost' IDENTIFIED BY 'ryuWyawEv';

or with a unix_socket plugin (INSTALL PLUGIN unix_socket SONAME 'auth_socket')

  CREATE USER 'munin'@'localhost' IDENTIFIED WITH unix_socket;

Note: requires 'user munin' in the configuration.

The minimum required priviledges of the munin database user is:

  GRANT PROCESS, REPLICATION CLIENT ON *.* TO 'munin'@'localhost';

Warning and critical values can be set via the environment in the usual way. For example:

  [mysql_replication]
    env.slave_io_running_warning 0.5
    env.slave_sql_running_warning 0.5
    env.seconds_behind_master_warning 300
    env.seconds_behind_master_critical 600

DEPENDENCIES

Cache::Cache

The plugin uses shared memory to cache the statistics gathered from MySQL. This ensures minimal inpact on the MySQL server.

DBD::mysql

INTERPRETATION

InnoDB

The statistics from innodb are mainly collected from the command

  SHOW ENGINE INNODB STATUS

A nice walk through is found at http://www.mysqlperformanceblog.com/2006/07/17/show-innodb-status-walk-through/

The graphs

FIX point to relevant sections in the MySQL manual and other www resources for each graph

mysql_replication

slave_io_running and slave_sql_running both translate the "Yes" values to 0 and anything else to 1 for their respective fields in the "SHOW SLAVE STATUS" output. This can be used to warn on slave failure if the warning and critical values are set as seen in a previous section.

LICENSE

Copyright (C) 2008,2009 Kjell-Magne Øierud

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 dated June, 1991.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

VERSION

git-master + a few munin modifications

This plugin was downloaded from http://github.com/kjellm/munin-mysql/

MAGICK MARKERS

  #%# family=auto
  #%# capabilities=suggest autoconf