创建主备关系系统,对主备和同步一览无余
关键性能指标图标展现
查看关键信息,这部分完全自定义
创建监控指标,健康同步状态(完全自定义):记录实例和角色状态
监控代码如下:
ps -ef|grep mysqld|grep mysql|grep basedir|awk -F mysqld '{print $2}'|awk '{print $1 "=" $7}'|awk -F = '{print $2"/bin/mysql "$4 }' > tmp001 2>&1 while read Line do echo "[client] port=$(echo $Line|awk '{print $2}') host=`hostname` user=mysqluser password=mysqluser " > /tmp/my.password #echo $(echo "$(echo $Line|awk '{print $1}')" --defaults-extra-file=/tmp/my.password -e \"SHOW SLAVE STATUS \\G\" ) vvv=$(echo "$(echo $Line|awk '{print $1}')" --defaults-extra-file=/tmp/my.password -e \"SHOW SLAVE STATUS \\G\" ) Slave_IO_Running=$(echo $vvv|sh|grep Slave_IO_Running|awk '{print $2}') > /tmp/01 2>&1 echo $(echo $Line|awk '{print $2}') "|"`hostname`" |" ${Slave_IO_Running:-NO} done < tmp001
标签:tmp,echo,awk,oem,mysql,print,主备,Line From: https://www.cnblogs.com/notonlydba/p/18400777