yum install http://www.percona.com/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noarch.rpm
yum install percona-zabbix-templates php php-mysql
3.
[root@web02 ~]# rpm -ql percona-zabbix-templates /var/lib/zabbix/percona /var/lib/zabbix/percona/scripts /var/lib/zabbix/percona/scripts/get_mysql_stats_wrapper.sh /var/lib/zabbix/percona/scripts/ss_get_mysql_stats.php /var/lib/zabbix/percona/templates /var/lib/zabbix/percona/templates/userparameter_percona_mysql.conf /var/lib/zabbix/percona/templates/zabbix_agent_template_percona_mysql_server_ht_2.0.9-sver1.1.7.xml #此模板可以导出来,然后倒入zabbix 但是由于版本的问题 zabbix导入不成功
,所以用文件夹内的(班长给的)的数据库模板即可
4.拷贝配置文件
cp /var/lib/zabbix/percona/templates/userparameter_percona_mysql.conf /etc/zabbix/zabbix_agentd.d/ 5. cd /var/lib/zabbix/percona/scripts/ cp ss_get_mysql_stats.php ss_get_mysql_stats.php.cnf vim ss_get_mysql_stats.php.cnf [root@web02 scripts]# cat /var/lib/zabbix/percona/scripts/ss_get_mysql_stats.php.cnf <?php $mysql_user = ‘user‘; #数据库的用户名和密码 此用户必须授予localhost 的权限 $mysql_pass = ‘*********‘; [root@web02 scripts]#
重启zabbix客户端
chown zabbix.zabbix /tmp/localhost-mysql_cacti_stats.txt systemctl restart zabbix-agent.service
6.导入模板
7.稍等片刻即可出图
备注:请参考 percona的官方文档
https://www.percona.com/doc/percona-monitoring-plugins/1.1/zabbix/index.html#installation-instructions
本文出自 “砖家博客” 博客,请务必保留此出处http://wsxxsl.blog.51cto.com/9085838/1894435
原文地址:http://wsxxsl.blog.51cto.com/9085838/1894435