Configure the Environment:
CentOS 6.6
Zabbix Server and agent:2.4.7
Percona Monitoring Plugins for zabbix:1.1
Pre-conditions: Zabbix agent has been installed: If using the source code installation, please compile with the following parameters
Configure--prefix=/--enable-agent
1 Install the dependency package php php-mysqlyum install -y php php-mysql2 install plug-in wget https:// www.percona.com/downloads/percona-monitoring-plugins/1.1.6/percona-zabbix-templates-1.1.6-1.noarch.rpm rpm -ivh percona-zabbix-templates-1.1.6-1.noarch.rpm3 copy plug-in monitoring item configuration file mkdir -p /etc/ zabbix_agentd.conf.d/cp /var/lib/zabbix/percona/templates/userparameter_percona_mysql.conf /etc/ zabbix_agentd.conf.d/userparameter_percona_mysql.conf4 vi /etc/zabbix_agentd.conf Add the following include= /etc/zabbix_agentd.conf.d/5 login MySQL Create a monitor to use the account mysql>grant select, process, super, replication client on *.* to ' zabbixmoniter ' @ ' localhost ' identified by "WERTSDFG" 6 Modify the configuration file's database account Vi /var/lib/zabbix/percona/scripts/ss_get_mysql_stats.php$mysql_user = ' Zabbixmoniter '; $mysql _pass = ' WERTSDFG '; $mysql _port = 3001; if MySQL does not use the default port, You also need to modify the following script file, Brother here has been pit for a long time vi /var/lib/zabbix/percona/scripts/get_mysql_stats_wrapper.shcachefile= "/tmp/$HOST-mysql_cacti_stats.txt:3001" TIMEFLM= ' stat -c %y /tmp/$HOST-mysql_cacti_stats.txt:3001 ' 7 create Zabbix user will have the following file authorization owner as zabbixget_ mysql_stats_wrapper.shss_get_mysql_stats.php/tmp/$HOST-mysql_cacti_stats.txt:30018 Test client run the following command to test whether the plug-in is working correctly. The/var/lib/zabbix/percona/scripts/get_mysql_stats_wrapper.sh gg server runs the following command to test whether the value can be obtained properly zabbix_get - s client ip -p 10050 -k "mysql.threads-connected" 9 If you need to monitor the slave node also need to make the following configuration into Zabbix's home directory to create ". My.cnf" hidden files, as follows [client]user=zabbixmoniterpassword= "WERTSDFG" #注意: Password to use double quotes 10 test Slave monitoring Item client run the following command: sudo -u zabbix -h /var/lib/zabbix/percona/ scripts/get_mysql_stats_wrapper.sh running-slave11 Server Import Template template file location is as follows: Copy it, browser login Zabbix server Select template Import CD /var/lib/zabbix/percona/templateszabbix_agent_template_percona_mysql_server_ht_2.0.9-sver1.1.6.xml12 Server Add monitoring host percona mysql server template altogether has 191 monitoring items
:
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/7E/1C/wKioL1b3597xbr5DAAGQ_ggk5eU653.png "style=" float: none; "title=" Qq20160327215615.png "alt=" Wkiol1b3597xbr5daagq_ggk5eu653.png "/>
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/7E/20/wKiom1b350HgELVyAAC5wYiDebE565.png "style=" float: none; "title=" Qq20160327215802.png "alt=" Wkiom1b350hgelvyaac5wyidebe565.png "/>
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/7E/20/wKiom1b350LBOisOAACRfm5kUe4762.png "style=" float: none; "title=" Qq20160327215916.png "alt=" Wkiom1b350lboisoaacrfm5kue4762.png "/>
This article is from "I bo so in" blog, please be sure to keep this source http://encoding.blog.51cto.com/1403836/1757326
Percona monitoring Plugins for Zabbix installation and configuration