Percona Monitoring Plugins for Nagios

Many of the freely available Nagios plugins for MySQL are poor quality, with no formal testing and without good documentation. A more serious problem, however, is that they are not created by experts in MySQL monitoring, so they tend to cause false alarms and noise, and don’t encourage good practices to monitor what matters.

These plugins offer the following improvements:

  • Created by MySQL experts.
  • Good documentation.
  • Support for the newest versions of MySQL and InnoDB.
  • Integration with other Percona software, such as Percona Server and Percona Toolkit.
  • Easy to install and configure.
  • Real software engineering! There is a test suite, to keep the code high quality.

The plugins are designed to be executed locally or via NRPE. Most large installations should probably use NRPE for security and scalability.

In general, the plugins either examine the local UNIX system and execute commands, or they connect to MySQL via the mysql commandline executable and retrieve information. Some plugins combine these actions. Each plugin’s documentation explains its commandline options and arguments, as well as the commands executed and the privileges required.

System Requirements

The plugins are all written in standard Unix shell script. They should run on any Unix or Unix-like operating system, such as GNU/Linux, Solaris, or FreeBSD.

The plugins are designed to be used with MySQL 5.0 and newer versions, but they may work on 4.1 or older versions as well.

Installation Instructions

You can download the tarball from the Percona Software Downloads directory or install the package from Percona Software Repositories:

yum install percona-nagios-plugins

or:

apt-get install percona-nagios-plugins

Configuration Best Practices

These plugins can be used locally or via NRPE. NRPE is the suggested configuration. Some plugins execute commands that require privileges, so you may need to specify a command prefix to execute them with sudo.

For security reasons, it is recommended to not pass MySQL access credentials in the arguments. You can create /etc/nagios/mysql.cnf and the plugins will use it like the default .my.cnf file. For example:

[root@centos6 ~]# cat /etc/nagios/mysql.cnf
[client]
user = root
password = s3cret
[root@centos6 ~]# chown root:nagios /etc/nagios/mysql.cnf
[root@centos6 ~]# chmod 640 /etc/nagios/mysql.cnf

Also with MySQL 5.6 client you can use the login-path instead of the password or .my.cnf, /etc/nagios/mysql.cnf files. For this, you need to specify -L option, e.g. -L safelogin. The actual .mylogin.cnf file should be created with mysql_config_editor tool and in case of Nagios, placed into nagios user home directory.

Here you can find an excerpt of potential Nagios config click here.

And here is an excerpt of related NRPE config:

command[rdba_unix_memory]=/usr/lib64/nagios/plugins/pmp-check-unix-memory -d -w 96 -c 98
command[rdba_mysql_pidfile]=/usr/lib64/nagios/plugins/pmp-check-mysql-pidfile

Support Options

If you have questions, comments, or need help with the plugins, there are several options to consider.

You can get self-service help via Percona’s forums, or the Percona mailing list.

You can report bugs and submit patches to the Launchpad project.

If you need help with installation, troubleshooting, configuration, selecting services to monitor, deciding on appropriate thresholds, writing more plugins, extending or modifying existing plugins, or fixing bugs in plugins, you may wish to consider a MySQL Support Contract from Percona. These monitoring plugins are fully supported under all Percona contracts.

© Copyright 2012, Percona Inc.
Except where otherwise noted, this documentation is licensed under the following license:
CC Attribution-ShareAlike 2.0 Generic
This documentation is developed in Launchpad as part of the Percona Monitoring Plugins source code.
If you spotted innacuracies, errors, don't understood it or you think something is missing or should be improved, please file a bug.