Build precise queries to find exactly what you need
Press ESC to close
Your review has been submitted and is pending approval.
This plugin is checking timestamp of the last table update (on the slave side) and comparing it with the current system time. It is suitable for checking MASTER-SLAVE and MASTER-MASTER replication. Requirements: - latest mk-heartbeat (http://www.maatkit.org/download) - Python MySQL connector (http://dev.mysql.com/downloads/connector/python/)
Current Version
1.01
Last Release Date
2012-12-23
Owner
Andrew
Compatible With
This plugin is checking timestamp of the last table update (on the slave side) and comparing it with the current system time.
You must choose server_id, warning and critical interval in seconds.
The latest version of mk-heartbeat should be installed and running with options: --update --daemonize
The heartbeat table should be such:
CREATE TABLE heartbeat ( ts varchar(26) NOT NULL, server_id int unsigned NOT NULL PRIMARY KEY, file varchar(255) DEFAULT NULL, -- SHOW MASTER STATUS position bigint unsigned DEFAULT NULL, -- SHOW MASTER STATUS relay_master_log_file varchar(255) DEFAULT NULL, -- SHOW SLAVE STATUS exec_master_log_pos bigint unsigned DEFAULT NULL -- SHOW SLAVE STATUS );
(latest mk-heartbeat can create this table via option '--create-table')
Requirements: - latest mk-heartbeat (http://www.maatkit.org/download) - Python MySQL connector (http://dev.mysql.com/downloads/connector/python/)
Example usage:
1) MASTER -> SLAVE Replication:
1. Run on MASTER mk-heartbeat:
mk-heartbeat -u heartbeat -p hfnLgg1 -D my_db --update --daemonize
(or with --create-table if you run mk-heartbeat in first time)
2. Check table data:
mysql -u heartbeat -phfnLgg1 my_db -e "select * from heartbeat";
+----------------------------+-----------+-------------------+----------+-----------------------+---------------------+ | ts | server_id | file | position | relay_master_log_file | exec_master_log_pos | +----------------------------+-----------+-------------------+----------+-----------------------+---------------------+ | 2012-12-23T20:14:18.000960 | 1 | MASTER-bin.000004 | 944011 | NULL | NULL | +----------------------------+-----------+-------------------+----------+-----------------------+---------------------+ 1 row in set (0.00 sec)
3. Run on SLAVE:
$ check_mk_heartbeat.py user:heartbeat pw:hfnLgg1 db:my_db host:localhost sid:1 warn:60 crit:120
Output: SLAVE OK: 0.23 seconds behind master (warn - 60.00, crit - 120.00), master_log_file = MASTER-bin.000004, master_log_pos = 944011
2) MASTER <-> MASTER Replication:
1. Run on each MASTER:
(by default mk-heartbeat uses server_id of local mysql server, so you do not have to worry - mk-heartbeat data are not mixed)
2. Check each SLAVE:
where 'sid' - server_id of MASTER for current SLAVE.
LAST CHANGES: - Fixed plugin OUTPUT (old version shows wrong master_log_file and master_log_pos) - Fixed UNKNOWN state (old version shows UNKNOWN sate on MASTER-SLAVE replication)
You must be logged in to submit a review.
To:
From:
We’ve completely redesigned the world’s largest repository of Nagios plugins and monitoring tools. Join thousands of users sharing monitoring solutions for servers, applications, and everything in between.
Due to our redesign, all existing accounts require a password reset to access your account again.
Ready to explore 6,100+ projects and contribute to the community?
Reset Password Create Account
Happy Monitoring!