percona为MySQL制作了专用插件,监控项,模版,图形。zabbix server端版本为
3.0
.7,之前已经介绍过安装步骤,这里不再做说明,请参考
http:
//www.cnblogs.com/Csir/p/6753412.html
主机
#agent端
[root@db02 ~]# hostname ;hostname -I
db02
10.0.0.52 172.16.1.52
#server端
[root@zabbix ~]# hostname;hostname -I
zabbix
10.0.0.120 172.16.1.120
环境
[root@db02 ~]# cat /etc/redhat-release
CentOS release 6.8 (Final)
[root@db02 ~]# /etc/init.d/iptables status
iptables: Firewall is not running.
[root@db02 ~]# getenforce
Disabled
zabbix-agent
1.安装zabbix-agent以及percona相关包
yum install zabbix-agent php php-mysql -y rpm -ivh https://www.percona.com/downloads/percona-monitoring-plugins/percona-monitoring-plugins-1.1.7/binary/redhat/6/x86_64/percona-zabbix-templates-1.1.7-2.noarch.rpm
percona相关文件如下
[root@db02 percona]# pwd
/var/lib/zabbix/percona
[root@db02 percona]# tree
.
├── scripts
│ ├── get_mysql_stats_wrapper.sh
│ └── ss_get_mysql_stats.php
└── templates
├── userparameter_percona_mysql.conf
└── zabbix_agent_template_percona_mysql_server_ht_2.0.9-sver1.1.7.xml
2.复制配置文件
chown -R zabbix.zabbix /var/lib/zabbix/percona/
mkdir -p /var/lib/mysql
ln -s /application/mysql/data/mysql.sock /var/lib/mysql/mysql.sock
cp /var/lib/zabbix/percona/templates/userparameter_percona_mysql.conf /etc/zabbix/zabbix_agentd.d/
/etc/init.d/zabbix-agent restart
3.在Agent节点上配置和验证与127.0.0.1的MySQL连接
注意事项
1、tmp etc var/lib/zabbix 必须有zabbix权限
2,server 测试zabbix_get -s 172.16.6.62 -I 172.16.3.3 -k MySQL.Questions