现在位置 >首页 > mysql主从监控
0℃
2012年11月13日 monitor, Mysql, shell ⁄ 被围观 3,170 view+
#!/bin/bash status=`mysql -uroot -p12345 -e"show slave status\G" | grep "Running" | awk '{if ($2 != "Yes") {print "No";exit 1}}'` if [ "$status" == "No" ];then echo "slave is not working!" [ ! -f "/tmp/slave" ] && echo "Slave is not working!" | mail -s "Warn!MySQL Slave is not working" slave@centos.bz touch /tmp/slave else echo "...
阅读全文
×
腾讯微博