Zabbix monitoring MySQL master-slave status

Source: Internet
Author: User

    1. 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.