Script for MySQL Replication Monitoring

 

As a Database Administrator, Monitoring of database is the most important part. As all we know Prevention is better than cure,

So. I am in this article comes with Replication Monitoring.

In replication monitoring, mainly we need to look into three things “sql_thread_running”, “io_thread_running” and the lag between master and slave.

The below script will help you in replication monitoring.

Thank You.

Rahul Shekhawat
Author: Rahul Shekhawat

2 comments

  1. Richard L. Buskirk

    Rahul Shekhawat, I would suggest the implementation of a MySQL path. The first place the bad guys look when they have access to a server is the cron jobs and running processes. Beautiful script, the design is very thin and precise.

    The thought around the MySQL path is that you can really lock it down, to the point that it has very limited abilities and 1 point of access on the user. This way they can’t use this user in an exploit or from another location. The only grant required is REPLICATION CLIENT
    Example: GRANT REPLICATION CLIENT ON *.* to rep_monitor@script_location_ip_address IDENTIFIED BY ‘the_password_you_want_to_use’;

Leave a Reply

Your email address will not be published. Required fields are marked *