添加模板
配置 Zabbix Server
- Grab the latest tarball from the Percona Software Downloads directory to your desktop.
- Unpack it to get zabbix/templates/ folder.
- Import the XML template using Zabbix UI (Configuration -> Templates -> Import) by additionally choosing “Screens”.
- Create/edit hosts by assigning them “Percona Templates” group and linking the template “Percona MySQL Server Template” (Templates tab).
上面一段直接摘抄于官方文档,因为写得已经很具体了
总结
- 安装插件包 percona-zabbix-templates
- 拷贝配置 userparameter_percona_mysql.conf
- 配置密码 ss_get_mysql_stats.php.cnf
- 安装依赖包 php php-mysql
- 给 zabbix 赋权
- 从 zabbix-server 进行连接测试
- 添加模板
命令汇总
mysql -Vcp /var/lib/zabbix/percona/templates/userparameter_percona_mysql.conf /etc/zabbix/zabbix_agentd.d/cat /var/lib/zabbix/percona/scripts/ss_get_mysql_stats.php.cnf/var/lib/zabbix/percona/scripts/get_mysql_stats_wrapper.sh ggyum install php php-mysqlcat /tmp/localhost-mysql_cacti_stats.txtcat /var/lib/zabbix/percona/scripts/get_mysql_stats_wrapper.shsudo -u zabbix -H /var/lib/zabbix/percona/scripts/get_mysql_stats_wrapper.sh running-slavesudo -u zabbix -H /var/lib/zabbix/percona/scripts/get_mysql_stats_wrapper.sh ggchown zabbix.zabbix /tmp/localhost-mysql_cacti_stats.txtmkdir /home/zabbixcp /etc/skel/.* /home/zabbix/chown -R zabbix.zabbix /home/zabbix/vim .my.cnfzabbix_get -s mysql-server -p 10050 -k "MySQL.running-slave"zabbix_get -s mysql-server -p 10050 -k "MySQL.Threads-connected"zabbix_get -s mysql-server -p 10050 -k "MySQL.max-connections"
原文地址


