1. Zabbix Client Editing Script/tmp/shell/mysql_slave_status.sh
#! /bin/bash/usr/bin/mysql-p123456-e ' show slave status \g; ' | Grep-e "Slave_io_running| Slave_sql_running "|awk ' {print $} ' |grep-c" yes "
2. Granting of executive authority
chmod +x mysql_slave_status.sh
3. Modify the Zabbix client configuration file/etc/zabbix/zabbix_agentd.conf
Unsafeuserparameters=1
Userparameter=mysql.slave.status,/tmp/shell/mysql_slave_status.sh
4. Zabbix Service-side test
Zabbix_get-s 172.16.115.157-p10050-k Mysql.slave.status
5. Adding monitoring items and triggers to the web side
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M00/8E/D5/wKiom1jLu2aDsl-6AABgPuZD5lc852.png "style=" float : none; "title=" 2.png "alt=" Wkiom1jlu2adsl-6aabgpuzd5lc852.png "/>
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M00/8E/D5/wKiom1jLu2ax1o18AACsVEGyLcU680.png "style=" float : none; "title=" 3.png "alt=" Wkiom1jlu2ax1o18aacsvegylcu680.png "/>
This article is from "A horse on the Plains" blog, please be sure to keep this source http://huangzp.blog.51cto.com/12434999/1907723
Zabbix monitoring MySQL master-slave status