percona模版监控mysql

安装php环境
percona需要php环境
yum install php php-mysql -y

下载安装percona
https://downloads.percona.com/downloads/percona-monitoring-plugins/percona-monitoring-plugins-1.1.8/binary/redhat/7/x86_64/percona-zabbix-templates-1.1.8-1.noarch.rpm

rpm -ich percona-zabbix-templates-1.1.8-1.noarch.rpm
在这里插入图片描述

修改get_mysql_stats_wrapper.sh
修改get_mysql_stats_wrapper ss_get_mysql_stats.php数据库登陆信息
第19行添加mysql账号密码
vim /var/lib/zabbix/percona/scripts/get_mysql_stats_wrapper.sh
在这里插入图片描述
vim /var/lib/zabbix/percona/scripts/ss_get_mysql_stats.php
在这里插入图片描述

复制自定义监控项配置文件到zabbix目录
cp /var/lib/zabbix/percona/templates/userparameter_percona_mysql.conf /etc/zabbix/zabbix_agentd.d/

在这里插入图片描述

重启zabbix-agent
systemctl restart zabbix-agent.service

测试KEY
zabbix_get -s 127.0.0.1 -k MySQL.Sort-scan
在这里插入图片描述

导入模板

在这里插入图片描述
在这里插入图片描述

把模板应用到监控主机
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/bjgaocp/article/details/111029975