mysql主從狀态檢測:
echo "show slave status\G;"|mysql -uroot -pyanghui|grep Running|awk -F: '{print $2}'|wc -c
MySQL運作狀态檢測:
echo "show processlist\G;"|mysql -uroot -pyanghui|grep -i host:|grep [0-9]|sed 's/Host://g'
本文轉自 boy461205160 51CTO部落格,原文連結:http://blog.51cto.com/461205160/1754652