码迷,mamicode.com
首页 > 数据库 > 详细

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

时间:2014-09-19 19:15:56      阅读:236      评论:0      收藏:0      [点我收藏+]

标签:http   ar   art   sp   cti   代码   log   on   c   

脚本代码如下:
#!/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不同步发邮件通知的脚本

标签:http   ar   art   sp   cti   代码   log   on   c   

原文地址:http://www.cnblogs.com/Alight/p/3982056.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!