zabbix监控Mysql
1.安装php php-mysql
yum install php php-mysql
2.安装percona-zabbix-templates
yum install http://repo.percona.com/yum/percona-release-latest.noarch.rpm
yum install percona-zabbix-templates
3.配置agent,拷贝percona自定义监控变量配置文件
cp /var/lib/zabbix/percona/templates/userparameter_percona_mysql.conf /etc/zabbix/zabbix_agentd.d/
4.重启zabbix-agent
systemctl restart zabbix-agent
5.编辑配置文件,插入如下内容,根据实际情况填写
cat /var/lib/zabbix/percona/scripts/ss_get_mysql_stats.php.cnf
<?php
$mysql_user = 'root';
$mysql_pass = '';
6本地测试一下
/var/lib/zabbix/percona/scripts/get_mysql_stats_wrapper.sh gg
7模板下载地址
http://jaminzhang.github.io/soft-conf/Zabbix/zbx_percona_mysql_template.xml
直接导入到zabbix-server 模板里面即可使用
zabbix监控Mysql
http://www.jcwit.com/article/202/