1, install the monitoring plug-in
wget https://www.percona.com/downloads/percona-monitoring-plugins/percona-monitoring-plugins-1.1.7/binary/ redhat/6/x86_64/percona-zabbix-templates-1.1.7-2.noarch.rpm
RPM-IVH percona-zabbix-templates-1.1.7-2.noarch.rpm
Yum Install percona-zabbix-templates PHP php-mysql-y
2. Modify the Zabbix agent configuration file
Cp/var/lib/zabbix/percona/templates/userparameter_percona_mysql.conf/usr/local/zabbix/etc/zabbix_agentd.conf.d /
Vim/usr/local/zabbix/etc/zabbix_agentd.conf
include=/usr/local/zabbix/etc/zabbix_agentd.conf.d/
Killall-9 Zabbix_agentd
/usr/local/zabbix/sbin/zabbix_agentd
3. Create MySQL Account
Mysql> GRANT select,process,super,replication CLIENT on * * to ' zabbixmoniter ' @ ' localhost ' identified by "123456";
mysql> flush Privileges;
4. Modify the plug-in configuration file
vim/var/lib/zabbix/percona/scripts/ss_get_mysql_stats.php
$mysql _user = ' zabbixmoniter ';
$mysql _pass = ' 123456 ';
$mysql _port = 3306;
$mysql _socket = '/tmp/mysql.sock ';
5, create Zabbix user MySQL user account (for monitoring slave)
Su-zabbix
Vim ~/.MY.CNF
[Client]
user = Zabbixmoniter
Password = 123456
Socket =/tmp/mysql.sock
6. Test slave
Su-zabbix
Sh/var/lib/zabbix/percona/scripts/get_mysql_stats_wrapper.sh Running-slave
7. Import templates
Template:
Http://jaminzhang.github.io/soft-conf/Zabbix/zbx_percona_mysql_template.xml
Reference blog:
http://www.ywnds.com/?p=6199
http://10880347.blog.51cto.com/346720/1932100
http://jaminzhang.github.io/monitoring/Monitoring-MySQL-using-Percona-Monitoring-Plugins-in-Zabbix/
Zabbix 3 uses Percona monitoring Plugins to monitor MySQL