|
1
1
| yum install percona-zabbix-templates php php-mysql
|
3.
1
2
3
4
5
6
7
8
| [iyunv@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.拷贝配置文件
1
2
3
4
5
6
7
8
9
10
| 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
[iyunv@web02 scripts]# cat /var/lib/zabbix/percona/scripts/ss_get_mysql_stats.php.cnf
<?php
$mysql_user = 'user'; #数据库的用户名和密码 此用户必须授予localhost 的权限
$mysql_pass = '*********';
[iyunv@web02 scripts]#
|
重启zabbix客户端
1
2
| chown zabbix.zabbix /tmp/localhost-mysql_cacti_stats.txt
systemctl restart zabbix-agent.service
|
6.导入模板
7.稍等片刻即可出图
备注:请参考 percona的官方文档
https://www.percona.com/doc/perc ... lation-instructions
|
|
|
|
|
|
|