检测MYSQL不同步发邮件通知的脚本

脚本代码如下:
#!/bin/bash                                                                                                                # Info   : check mysql slave                                                                                               # Author : dingtm                                                                                                          # CTime  : 2011.03.21                                                                                                      # This script run by root                                                                                                                                                                                                                             DBDir=/elain/apps/mysql/bin/                                                                                               DBSock=/elain/data/mysql/3306/mysql.sock                                                                                   Log=/tmp/mysql_slave.log                                                                                                   DBUser=root                                                                                                                DBPasswd=elain                                                                                                        MailList=elain@elain.org,elain2012@hotmail.com                                                                                                                                                                                                           Seconds_Behind_Master=$(${DBDir}mysql -u${DBUser} -p${DBPasswd} -S ${DBSock} -e "show slave status\G;" | awk -F‘:‘ ‘/Seconds_Behind_Master/{print $2}‘)                                                                                              
本文来自: 华盟黑客(中国最大黑客培训中心网站) 详细出处参考:http://www.hmhack.com/article/html/283.html

检测MYSQL不同步发邮件通知的脚本

上一篇:mysql自动备份策略


下一篇:MySQL查询缓存详解