First on the monitored script:
#!/bin/bashstatus= ' Mysql-u root-p123-e "show Slave Status\g" | Egrep "Slave_io_running| Slave_sql_running "| Awk-f: ' {print $} ' | TR "\ n" "" ' arr_status= (' echo $status ') [[${arr_status[0]} =~ "yes"] && [[${arr_status[1]} =~ "yes"]] &&am P Echo 1 | | Echo 0
Where the password entry needs to change its own password. Of course, you can define your own settings for variables.
2. Then add key-value monitoring on the AGENTD side:
/usr/local/zabbix_agent/etc/zabbix_agentd.conf:
userparameter=mysql.slave,sh/shell/mysql_slave.sh
Restart Agentd.
3. Add the appropriate monitoring entries on the Zabbix Web side:
650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>650 "this.width=650;" src= "http ://s4.51cto.com/wyfs02/m01/80/3c/wkiol1c8cdkrr2mbaabc-6fnekq406.png "title=" 1.png "alt=" Wkiol1c8cdkrr2mbaabc-6fnekq406.png "/>
4. Set the trigger:
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/80/3C/wKioL1c8CIGhkWjcAAA0oET9oZc163.png "title=" 2.png " alt= "Wkiol1c8cighkwjcaaa0oet9ozc163.png"/>
The trigger is the last value to be taken, and if the last value is not equal to 1, the alarm will be called.
Zabbix monitoring MySQL master-slave status