1. Install Agent client First
Tar zxvf zabbix-3.2.6. TAR.GZCD Zabbix-3.2.6. /configure--prefix=/data/zabbix--enable-java --enable-agent--with-net-snmp--with-libcurl--with-openiomi-- With-unixodbc--with-ldap--with-ssh2--with-openipmi--with-jabbermakemake Install
2. Download the percona-zabbix-templates template
wget https://www.percona.com/downloads/percona-monitoring-plugins/percona-monitoring-plugins-1.1.7/binary/ redhat/7/x86_64/percona-zabbix-templates-1.1.7-2.noarch.rpm
3. Installing PHP and Php-mysql Services
Yum- y install php php-mysql
4. Installing Percona-zabbix-templates
RPM-IVH percona-zabbix-templates-1.1.7-2.noarch.rpm
5. Modify the Zabbix configuration file
Vim/data/zabbix/etc/zabbix_agentd.conf
Add to/var/lib/zabbix/percona/templatesuserparameter_percona_mysql.conf content
6. Import a template
In the Zabbix Web page import/var/lib/zabbix/percona/zbx_percona_mysql_template.xml (this is my own 3.0 of the default installation is 2.0 of the non-generic)
7. Authorization Script File
Chmod-r 777/var/lib/zabbix/percona/scripts/*
8. Modify the SH page according to your environment location
vim/var/lib/zabbix/percona/scripts/get_mysql_stats_wrapper.shhost=10.39.3.45 (native) CMD=" /data/php/bin/php (PHP installation location)cachefile="/tmp/$HOST-mysql_zabbix_stats.txt " (temporary file location) RES= ' home=~zabbix/data/mysql/bin/mysql (mysql installation location)
9. Modify the PHP page according to your environment location
' Root ' 'thad6zelma7_grope3936pollution'= 3306; Port
Replace cacti to Zabbix
10. Troubleshooting
Error: Rm:cannot remove ' not permitted
If the TMP below does not prompt the file to be created, if there is to give 777 permission
Going to get the data test
Zabbix_get-s 192.168.137.3-p 10050-k "Mysql.running-slave"
Monitor MySQL using Percona monitoring Plugins in Zabbix