#!/bin/bash
# replication monitoring script
# and sending me an email in case of an issue
# Script written by Dmitry Lomaka, Kyiv 2012
# required: yum install mailx
# set up on the master server's cron to run once per hour
# crontab -e
## 00 * * * * ~/replication_control.sh
################################
var1=`echo "SHOW PROCESSLIST;" | mysql --user=root --password=*** | grep "replication"`
if [ -z "$var1" ]
then
echo "replication not work" | mail -s "replication" it.admin@seo-studio.ua
else
echo $(date)" "$var1 >> /var/log/replication_control.log
fi
################################
exit 0 # best wishes!
MySQL replication monitoring script
#!/bin/bash # replication monitoring script # and sending me an email in case of an issue # Script written by Dmitry Lomaka, Kyiv 2012 # required: yum install mailx # set up the master server's crontab to run once per hour # crontab -e ## 00 *…

Note: This post may be AI-assisted and then human-edited. Editorial responsibility: Dmytro Lomaka, Kaltenkirchen.