According to Percona's official program to do the monitoring of MySQL database, please refer to: https://www.percona.com/doc/percona-monitoring-plugins/1.1/zabbix/index.html
1, first install Percona source
# yum Install http://www.percona.com/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noarch.rpm
2. Install Zabbix Agent-related components
# yum Install-y percona-zabbix-templates
Also to install:
# Yum Install php php-mysql-y
3. Copying configuration files
# cp/var/lib/zabbix/percona/templates/userparameter_percona_mysql.conf/etc/zabbix/zabbix_agentd.d/
4, into the /var/lib/zabbix/percona/scripts directory, there are two configuration files need to be configured:
# Vim Get_mysql_stats_wrapper.sh
host=x.x.x.x (the IP address where MySQL resides)
# Vim ss_get_mysql_stats.ph
$mysql _user = ' xx ';
$mysql _pass = ' xx ';
$mysql _port = xx;
/var/lib/zabbix/percona/templates/in userparameter_percona_mysql.conf.
the path to the get_mysql_stats_wrapper.sh file must be clear, write your local path to the file! restart Zabbix-agent to take effect after setup.
5, this program needs to rely on PHP and Php-mysql
# yum Install Php-mysql php-y
6. Testing
/var/lib/zabbix/percona/scripts/get_mysql_stats_wrapper.sh GG
If there's a return data, it's OK.
After testing, delete the/tmp generated *-mysql_cacti_status.txt file and let the program call to create a new file yourself (remember to remember)
7. Import templates
Move the zabbix_agent_template_percona_mysql_server_ht_2.0.9-under the/var/lib/zabbix/percona/templates path Sver1.1.6.xml Import into Zabbix_server
Configuration--Templates--and Import-Select File
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"/>
Wait a minute, you'll be out of the picture.
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"/>
Go ahead and toss it.
650) this.width=650; "alt=" Zabbix-percona plug-in monitoring Mysql.docx "class=" editor-attachment "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; "/>
This article is from the "it Side dish" blog, make sure to keep this source http://3777119.blog.51cto.com/3767119/1835768
zabbix3.0 monitoring MySQL Database