今天重启zabbix-proxy时,发现zabbix-proxy所有的监控主机都失联了,看一下代理服务,两个多小时没有传递数据,zabbix-server监控的主机没有影响,数据正常,查看了一下找到了问题,分享出来,希望对大家有帮助。
1、重启zabbix-proxy时提示ok
$ sudo /etc/init.d/zabbix-proxy restart
[ ok ] Restarting zabbix-proxy (via systemctl): zabbix-proxy.service.
2、但是是无效重启,没有找到zabbix-proxy的服务端口
$ sudo netstat -lntup |grep zabbix
tcp 00 0.0.0.0:100500.0.0.0:* LISTEN 2329/zabbix_agentd
tcp6 00 :::10050:::* LISTEN 2329/zabbix_agentd
解决:
1、查看日志:
sudo tail zabbix_proxy.log
3195:20161219:143955.661 [Z3001] connection to database ‘zabbix_proxy‘ failed: [1045] Access denied for user ‘zabbix_proxy‘@‘localhost‘ (using password: YES)
3195:20161219:143955.661 database is down: reconnecting in 10 seconds
3195:20161219:144005.662 [Z3001] connection to database ‘zabbix_proxy‘ failed: [1045] Access denied for user ‘zabbix_proxy‘@‘localhost‘ (using password: YES)
3195:20161219:144005.663 database is down: reconnecting in 10 seconds
……
3195:20161219:144115.673 [Z3001] connection to database ‘zabbix_proxy‘ failed: [1045] Access denied for user ‘zabbix_proxy‘@‘localhost‘ (using password: YES)
3195:20161219:144115.673 database is down: reconnecting in 10 seconds
注:很明显连接到数据库的zabbix_proxy失败
2、登陆数据库,重新创建用户或密码
mysql> grant all on zabbix_proxy.* to zabbix_proxy@localhost identified by ‘You_Passwd‘;
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
注:创建的好的mysql-proxy要和zabbix_proxy.conf一致
3、很简单吧,到这里都结束了,Proxy恢复,(没有恢复的重启服务)
详细zabbix-proxy(分布式监控)可以参考我另一篇分享:
本文出自 “运维小当家” 博客,请务必保留此出处http://solin.blog.51cto.com/11319413/1883990
原文地址:http://solin.blog.51cto.com/11319413/1883990