Sql DB replication check


Hi all,
anybody got an idea how to check if a DB is replicating?
I have a distributed MySQL DB (one master 6 slaves) and would like to check if the replication is working…
My idea was to use a dummy record with a timestamp updated every 10 minutes on the master and then checking on the slaves if this timestamp is within 10 minutes… any better ideas?

Thx for your comments.



Go for it.
Just modify to suit and execute from command line.

more /usr/local/system.scripts/chkmysqlstatus.sh

#This script will check the master/slave status of tia3407 and alpha

echo “Output of show master status”
/usr/bin/mysql -pyourpassword -e "show master status"
echo ""
echo “Output of show slave status”
/usr/bin/mysql -pyourpassword -hremotehostnameip -e “show slave status”

The last line, you can dupe for each of your slaves with the appropriate slave ip/hostname/whatever.


Thanks. …never thought of checking THAT…
“why easy if you can have it difficult?” :smiley: