zabbix percona mysql 监控
1yum install http://www.percona.com/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noarch.rpm
[*]
[*]
1
yum install percona-zabbix-templates php php-mysql
3.
1
2
3
4
5
6
7
8
# rpm-qlpercona-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/
cpss_get_mysql_stats.phpss_get_mysql_stats.php.cnf
vim ss_get_mysql_stats.php.cnf
# cat /var/lib/zabbix/percona/scripts/ss_get_mysql_stats.php.cnf
<?php
$mysql_user = 'user';#数据库的用户名和密码此用户必须授予localhost 的权限
$mysql_pass = '*********';
#
重启zabbix客户端
1
2
chownzabbix.zabbix /tmp/localhost-mysql_cacti_stats.txt
systemctl restartzabbix-agent.service
6.导入模板
7.稍等片刻即可出图
备注:请参考 percona的官方文档
https://www.percona.com/doc/percona-monitoring-plugins/1.1/zabbix/index.html#installation-instructions
页:
[1]