时间:2021-07-01 10:21:17 帮助过:13人阅读
方案1: 使用官方 推荐的方案 https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/db/mysql
方案2: 自己写脚本
问题: 官方在 Zabbix 4.2.1
上测试通过,而我安装的zabbix 4.2.6
版本的. 在配置mysql用户信息时出问题了.
我直接创建一个zabbix 本地登录不要密码的用户解决的.
wget https://git.zabbix.com/projects/ZBX/repos/zabbix/raw/templates/db/mysql/template_db_mysql.conf?at=refs%2Fheads%2Fmaster -O /etc/zabbix/zabbix_agentd.d/template_db_mysql.conf
CREATE USER ‘zbx_monitor‘@‘%‘ IDENTIFIED BY ‘密码‘; GRANT USAGE,REPLICATION CLIENT,PROCESS,SHOW DATABASES,SHOW VIEW ON *.* TO ‘zbx_monitor‘@‘%‘;
create user 'zabbix'@'localhost';
GRANT USAGE,REPLICATION CLIENT,PROCESS,SHOW DATABASES,SHOW VIEW ON *.* TO 'zabbix'@'localhost';
flush privileges;
.my.cnf
in home directory of Zabbix agent for Linux (/var/lib/zabbix
by default ) or my.cnf
in c:?for Windows. The file must have three strings:[client]
user=zbx_monitor
password=设置的密码
https://git.zabbix.com/projects/ZBX/repos/zabbix/raw/templates/db/mysql/template_db_mysql.xml?at=refs%2Fheads%2Fmaster
在zabbix-server的web上导入即可.
操作路径是配置->模板->导入
选择上面下载的模板文件导入.
导入成功后
路径 配置->主机->新建
方案2:请参考下面网页
https://nicksors.cc/2018/06/22/Zabbix%E7%B3%BB%E5%88%97%E4%B9%8B%E3%80%8A%E7%9B%91%E6%8E%A7MySQL%E4%B8%BB%E4%BB%8E%E5%90%8C%E6%AD%A5%E3%80%8B.html
http://www.sunrisenan.com/docs/zabbix/zabbix-1ari17qg766mj
https://blog.51cto.com/chaixinwang/2057488
https://www.zabbix.com/documentation/3.4/zh/manual/concepts/get
zabbix监控mysql
标签:dir 导入 cat ESS mysq cli ica info class