下载percona-monitoring-plugins插件
http://www.percona.com/downloads/percona-monitoring-plugins/
安装插件:
rpm -ivh percona-zabbix-templates-1.1.3-1.noarch.rpm
安装完毕后文件在/var/lib/zabbix/percona目录下面
导入模版zabbix_agent_template_percona_mysql_server_ht_2.0.9-sver1.1.4.xml到zabbix服务端:
[[email protected] templates]# pwd
/var/lib/zabbix/percona/templates
[[email protected] templates]# ls
userparameter_percona_mysql.conf zabbix_agent_template_percona_mysql_server_ht_2.0.9-sver1.1.4.xml
把ss_get_mysql_stats.php复制到客户端/usr/local/zabbix-agent/etc/zabbix_agentd.conf.d下面
[[email protected] scripts]# pwd
/var/lib/zabbix/percona/scripts
[[email protected] scripts]# ls
get_mysql_stats_wrapper.sh ss_get_mysql_stats.php
cp ss_get_mysql_stats.php /usr/local/zabbix-agent/etc/zabbix_agentd.conf.d
修改 ss_get_mysql_stats.php 配置文件:
$mysql_user = 'root';
$mysql_pass = 'xxx';
mysql数据库的连接用户名密码。
注意:需要安装php环境支持。
在zabbix控制台添加mysql模版监控就好了。