Home Directory Plugins Databases MySQL check_mysql-replication.pl

Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com


Remember Me

Directory Tree


1 vote
check_mysql-replication.plsource code v0.1
Network Monitoring Software - Download Nagios XI
Log Management Software - Nagios Log Server - Download
Netflow Analysis Software - Nagios Network Analyzer - Download
Yet another plugin to check your mysql replication threads and your lag synchronisation
How to use :

1 - first you have to create an user with the REPLICATION CLIENT
(or you can just grant this privilege)
mysql> GRANT REPLICATION CLIENT ON *.* TO 'replicateur'@'localhost'

2 - then just run the script :
$./check_mysql-replication.pl --help
check_mysql-replication.pl version 0.1 by Erwan Labynocle Ben Souiden
This plugin checks your mysql replication threads and your lag synchronisation

Usage: //check_mysql-replication.pl [-a process|lag] [-p] [-D "CHECK MySQL REPLICATION - "] [-v] [-m] [-c 10] [-w 5]

-h, --help
Print detailed help screen
-V, --version
Print version information
-D, --display=STRING
to modify the output display...
-sa, --slave-address=STRING
address or name of the slave mysql server
default is
-sp, --slave-port=STRING
port number of the slave mysql server
default is 3306
-sl, --slave-login=STRING
mysql login
default is user1
-spd, --slave-password=STRING
mysql password
default is password1
-a, --action=STRING
specify the action : process|lag
default is process
process : display state of slave threads
lag : display the number of second behind the master
-c, --critical=INT
specify a threshold for the lag action.
default is 10
-w, --warning=INT
specify a threshold for the lag action.
default is 5
-m, --more
Print a longer output. By default, the output is not complet because
Nagios may truncate it. This option is just for you
-p, --perfdata
If you want to activate the perfdata output
-v, --verbose
Show details for command-line debugging (Nagios may truncate the output)

Send email to erwan@aleikoum.net if you have questions
regarding use of this software. To submit patches or suggest improvements,
send email to erwan@aleikoum.net
This plugin has been created by Erwan Labynocle Ben Souiden

Hope you will enjoy it ;)
Let me know if you find any bugs or if you have comments : erwanATaleikoumDOTnet
Reviews (1)
bynkadel, December 30, 2012
The structure of available options is good. The security is *BAD*. MySQL commands for replication should never, never, never be run from unprivileged command line arguments, because access to the Nagios configurations or the output of "ps auxwww" will reveal the name and password of the user with replication privileges.

This commandn would benefit strongly from access to a default configuration file, even a $HOME/.my.cnf for the Nagios user, that would protect access to the replication user account.