主机运行时,会报这个错,所以要先按安装Zabbix agent,
Zabbix-server在监控的过程中,发现Web上报错提示zabbix server与agent之间已经失联超过5分钟了,为了找到问题出现的根本原因,在troubleshouting的时候,应该首先去查看服务对应的日志。首先应该查看server端的日志有无错误消息,通过日志查看,发现server端运行正常,那么问题很可能就出现在了客户端上,来到这台agent上查看服务日志。
1.查看日志
[root@iZbp11rfoyeescusr9ha9qZ tmp]# find / -name *agentd.log
/var/log/zabbix/zabbix_agentd.log
[root@iZbp11rfoyeescusr9ha9qZ tmp]# vim /var/log/zabbix/zabbix_agentd.log
23904:20170310:092458.633 Starting Zabbix Agent [Zabbix server]. Zabbix 2.2.16 (revision 64243).
23904:20170310:092458.634 using configuration file: /etc/zabbix_agentd.conf
23915:20170310:092458.636 agent #1 started [listener #1]
23918:20170310:092458.636 agent #3 started [listener #3]
23917:20170310:092458.636 agent #2 started [listener #2]
23914:20170310:092458.636 agent #0 started [collector]
23919:20170310:092458.637 agent #4 started [active checks #1]
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)
23919:20170310:102358.983 active check configuration update from [127.0.0.1:10051] is working again
23919:20170310:102358.983 no active checks on server [127.0.0.1:10051]: host [Zabbix server] not monitored
23919:20170310:102559.020 no active checks on server [127.0.0.1:10051]: host [Zabbix server] not monitored
23919:20170310:102759.073 no active checks on server [127.0.0.1:10051]: host [Zabbix server] not monitored
23919:20170310:102959.109 no active checks on server [127.0.0.1:10051]: host [Zabbix server] not monitored
23904:20170310:103011.545 Got signal [signal:15(SIGTERM),sender_pid:26144,sender_uid:0,reason:0]. Exiting ...
23904:20170310:103011.547 Zabbix Agent stopped. Zabbix 2.2.16 (revision 64243).
26157:20170310:103011.659 Starting Zabbix Agent [Zabbix server]. Zabbix 2.2.16 (revision 64243).
26157:20170310:103011.659 using configuration file: /etc/zabbix_agentd.conf
26168:20170310:103011.663 agent #1 started [listener #1]
26172:20170310:103011.663 agent #4 started [active checks #1]
26171:20170310:103011.663 agent #3 started [listener #3]
26170:20170310:103011.663 agent #2 started [listener #2]
26166:20170310:103011.664 agent #0 started [collector]
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地址
[root@iZbp11rfoyeescusr9ha9qZ tmp]# vim /etc/zabbix/zabbix_agentd.conf
122 ServerActive=121.43.161.35
3.重启zabbix-agent服务,使得配置生效
[root@iZbp11rfoyeescusr9ha9qZ tmp]# /etc/init.d/zabbix-agentd restart
Shutting down Zabbix agent: [ OK ]
Starting Zabbix agent: [ OK ]
4.浏览器刷新页面,发现server端已经重新监控到agent运行状况的数据了
Tips: