Nagios MySQL Plug-Ins
There currently exist many plugins for MySQL to use with Nagios. Many of them, however, are not version-independent, leaving organizations that use multiple versions of MySQL to either install multiple plugins or not monitor specific versions of MySQL. As such, I’ve compiled what I consider to be the most useful checks into a single plugin: check_mysql
Usage:
check_mysql check_name [options]
Options:
--args|a Optional arguments. Comma-separated. Check-specific.
--critical|c The level at which a critical alarm is raised. Check-specific.
--database The database to use (defaults to mysql)
--help|? Display this message and exit
--hostname|H The target MySQL server host (defaults to localhost)
--password|p The password of the MySQL user
--port The port MySQL is listening on (defaults to 3306)
--user|u The MySQL user used to connect
--version|V Display version information and exit
--warning|w The level at which a warning is raised. Check-specific.
defaults are:
ATTRIBUTE VALUE
-------------------------- ------------------
args No default value
critical Check-specific
database mysql
help FALSE
host localhost
password No default value
port 3306
timeout 10 seconds
user No default value
verbose 1 (out of 3)
version FALSE
warning Check-specific
Current Checks Supported:
* connect – Check to see whether or not one can connect to MySQL (USAGE)
* repl_io – Check to see whether on not the IO Replication thread is running (REPLICATION CLIENT)
* repl_sql – Check to see whether or not the SQL Replication thread is running (REPLICATION CLIENT)
* repl_sbm – Check how many seconds behind the master the slave is (REPLICATION CLIENT)
* mysql_query – Run a given query, test if it executes properly (SELECT)
* connections – Test if the percentage of used connections is over a given threshold (PROCESS)
I am open to requests for additional checks etc.
March 9th, 2009 at 8:37 am
http://openquery.com/resources/tools/nagios_scripts
March 9th, 2009 at 10:33 am
@arjen Thanks for the link.
I considered adding checks for things like Key Cache Hit Rate, but really think that those metrics are better considered over time rather than as one-time alerts.
Following some of the links from your page, I found http://www.consol.de/opensource/nagios/check-mysql-health, which might be exactly what I was looking for
August 25th, 2009 at 8:21 am
Thank you for putting this together. You may want to update the script with the following download links as the ones in the script dont work anymore.
http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-3.2.0.tar.gz
http://prdownloads.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.13.tar.gz
February 16th, 2010 at 1:31 pm
Could you please tell me how to use this? Is this a part of nrpe check?
Or is this a separate nagios check itself?