1, installation Zabbix-agent
Yum-y Install zabbix-2.4.8-1.el6.x86_64.rpm zabbix-agent-2.4.8-1.el6.x86_64.rpm
Installation of the above two packages will be generated in the/ETC/ZABBIX/ZABBIX_AGENTD.D directory userparameter_mysql.conf This configuration file we just need to modify simply:
Modify the content as follows (if you only monitor the master and slave status configuration, if there are other monitoring items please refer to:http://www.cnblogs.com/fansik/p/7640942.html):
userparameter=slave_status,/usr/local/mysql/bin/mysql-uzabbix-pzabbix-e " show slave status\g; " 2 >/dev/null | grep -e " Slave_io_running| slave_sql_running " | awk " {print $ {} " | grep -C Yes
2, edit the agent side of the/etc/zabbix/zabbix_agentd.conf file modify the following content:
server=127.0.0.1
Replace with: (The red font is your own server-side IP)
server=Zabbix-server-ip
3. Start Zabbix-agent Service
/etc/init.d/zabbix-agent start
To test whether the status information is properly obtained:
Zabbix_get-s 10.10.80.44-k Slave_status
4. go to Zabbix admin interface to add MySQL master-slave status monitoring
To add a host:
To define a monitoring entry:
Define the trigger, if not equal to 2 alarm:
Zabbix-2.4.8-1 adding MySQL master-slave status monitoring