Install php environment
percona requires php environment
yum install php php-mysql -y
Download and install percona
https://downloads.percona.com/downloads/percona-monitoring-plugins/percona-monitoring-plugins-1.1.8/binary/redhat/7/x86_64/percona-zabbix-templates-1.1.8-1 .noarch.rpm
rpm -ich percona-zabbix-templates-1.1.8-1.noarch.rpm
Modify get_mysql_stats_wrapper.sh
modify get_mysql_stats_wrapper ss_get_mysql_stats.php database login information
Line 19 add the mysql account password
vim /var/lib/zabbix/percona/scripts/get_mysql_stats_wrapper.sh
vim / var/lib/zabbix_stats_get_scripts/s
Copy the custom monitoring item configuration file to the
zabbix directory cp /var/lib/zabbix/percona/templates/userparameter_percona_mysql.conf /etc/zabbix/zabbix_agentd.d/
重启zabbix-agent
systemctl restart zabbix-agent.service
测试KEY
zabbix_get -s 127.0.0.1 -k MySQL.Sort-scan
Import template
Apply the template to the monitoring host