1. Install PHP
yum install -y php php-mysql
2, Installation Percona-zabbix
yum install -y 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, Configuration Zabbix agentd
vim /usr/local/zabbix/etc/zabbix_agentd.conf Include=/usr/local/zabbix/etc/zabbix_agentd.conf.d/*.confcd /var/lib/zabbix/percona/templatescp userparameter_percona_mysql.conf /usr/local/zabbix/etc/zabbix_agentd.conf.d/killall -9 zabbix_agentdchown zabbix.zabbix /tmp/localhost-mysql_cacti_stats.txt
4. Configure MySQL Default login account
su - zabbixcat .my.cnf [client] password=MySQL2018 user=root
5. Modify PHP Scripts
cd /var/lib/zabbix/percona/scripts/vim ss_get_mysql_stats.php $mysql_user = ‘root‘; $mysql_pass = ‘MySQL2018‘; $mysql_port = 3306; $mysql_socket = ‘/tmp/mysql.sock‘;
6. Test to get MySQL data
cd /var/lib/zabbix/percona/scripts//usr/bin/php ss_get_mysql_stats.php --host localhost --items ggcd /usr/local/zabbix/bin./zabbix_get -s 172.16.2.39 -k MySQL.file-reads
7. Download the template into Zabbix
Https://www.ttlsa.com/wp-content/uploads/2016/07/Percona-MySQL-Server-Template.zip
Reference Documentation:
Download Percona Monitoring Plugins
zabbix3.0.2 using the Percona MySQL plugin to monitor the detailed implementation of mysql5.7
zabbix-3.0 Import Percona Template Error
Use the Percona MySQL plugin to monitor mysql5.7