前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Zabbix agent on Zabbix server is unreachable for 5 minutes

Zabbix agent on Zabbix server is unreachable for 5 minutes

作者头像
拓荒者
发布2019-08-27 10:48:49
2.6K2
发布2019-08-27 10:48:49
举报
文章被收录于专栏:运维经验分享运维经验分享

Zabbix agent on Zabbix server is unreachable for 5 minutes

主机运行时,会报这个错,所以要先按安装Zabbix agent,

Zabbix-server在监控的过程中,发现Web上报错提示zabbix server与agent之间已经失联超过5分钟了,为了找到问题出现的根本原因,在troubleshouting的时候,应该首先去查看服务对应的日志。首先应该查看server端的日志有无错误消息,通过日志查看,发现server端运行正常,那么问题很可能就出现在了客户端上,来到这台agent上查看服务日志。

1.查看日志

代码语言:javascript
复制
  1. [root@iZbp11rfoyeescusr9ha9qZ tmp]# find / -name *agentd.log
  2. /var/log/zabbix/zabbix_agentd.log
  3. [root@iZbp11rfoyeescusr9ha9qZ tmp]# vim /var/log/zabbix/zabbix_agentd.log
  4. 23904:20170310:092458.633 Starting Zabbix Agent [Zabbix server]. Zabbix 2.2.16 (revision 64243).
  5. 23904:20170310:092458.634 using configuration file: /etc/zabbix_agentd.conf
  6. 23915:20170310:092458.636 agent #1 started [listener #1]
  7. 23918:20170310:092458.636 agent #3 started [listener #3]
  8. 23917:20170310:092458.636 agent #2 started [listener #2]
  9. 23914:20170310:092458.636 agent #0 started [collector]
  10. 23919:20170310:092458.637 agent #4 started [active checks #1]
  11. 23919:20170310:092458.637 active check configuration update from [127.0.0.1:10051] started to fail (cannot connect to [[127.0.0.1]:10051]: [111] Connection refused)
  12. 23919:20170310:102358.983 active check configuration update from [127.0.0.1:10051] is working again
  13. 23919:20170310:102358.983 no active checks on server [127.0.0.1:10051]: host [Zabbix server] not monitored
  14. 23919:20170310:102559.020 no active checks on server [127.0.0.1:10051]: host [Zabbix server] not monitored
  15. 23919:20170310:102759.073 no active checks on server [127.0.0.1:10051]: host [Zabbix server] not monitored
  16. 23919:20170310:102959.109 no active checks on server [127.0.0.1:10051]: host [Zabbix server] not monitored
  17. 23904:20170310:103011.545 Got signal [signal:15(SIGTERM),sender_pid:26144,sender_uid:0,reason:0]. Exiting ...
  18. 23904:20170310:103011.547 Zabbix Agent stopped. Zabbix 2.2.16 (revision 64243).
  19. 26157:20170310:103011.659 Starting Zabbix Agent [Zabbix server]. Zabbix 2.2.16 (revision 64243).
  20. 26157:20170310:103011.659 using configuration file: /etc/zabbix_agentd.conf
  21. 26168:20170310:103011.663 agent #1 started [listener #1]
  22. 26172:20170310:103011.663 agent #4 started [active checks #1]
  23. 26171:20170310:103011.663 agent #3 started [listener #3]
  24. 26170:20170310:103011.663 agent #2 started [listener #2]
  25. 26166:20170310:103011.664 agent #0 started [collector]
  26. 26172:20170310:103011.667 no active checks on server [127.0.0.1:10051]: host [Zabbix server] not monitored

通过查看日志,发现23919:20170310:092458.637 这条日志记录告诉我们说,主动从[127.0.0.1:10051]检查配置更新失败,agent与server之间的连接失败。

2.修改agent的配置文件,将ServerActive的地址改为zabbix-server的IP地址

代码语言:javascript
复制
  1. [root@iZbp11rfoyeescusr9ha9qZ tmp]# vim /etc/zabbix/zabbix_agentd.conf
  2. 122 ServerActive=121.43.161.35

3.重启zabbix-agent服务,使得配置生效

代码语言:javascript
复制
  1. [root@iZbp11rfoyeescusr9ha9qZ tmp]# /etc/init.d/zabbix-agentd restart
  2. Shutting down Zabbix agent: [ OK ]
  3. Starting Zabbix agent: [ OK ]

4.浏览器刷新页面,发现server端已经重新监控到agent运行状况的数据了

Tips:

  1. 在troubleshouting查看服务日志的时候,可以将注意力集中在有显示“fail”或者“Error”这类失败的关键词上,这样可以快速排错,找到问题的原因,而不必通篇阅读所有的日志,极大的提高效率。
  2. 作为运维工程师,脑袋储存的信息可能比较多、杂,时而出现忘记了某个服务、配置文件的绝对路径,如果记得文件或者目录的完整名,可以使用“locate+文件名”命令来定位文件的绝对路径,若是连文件名也记不大清了,没关系,还可以用Linux平台强大的搜索命令find,以全局查找的方式,通过星号来匹配到想要查找的文件的绝对路径,例如:find / -name *agentd.conf (从/目录开始,全局搜索以agentd结尾的.conf文件)。这些都是作为一名运维工程师应该具备的基本技能,而不必通过死记硬背的方式来记忆所有文件的绝对路径。
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • Zabbix agent on Zabbix server is unreachable for 5 minutes
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档