get value from agent failed: cannot connect to [[127.0.0.1]:10050]: [111] Connection refused

部署zabbix服务端时,查看主机配置。

zabbix服务端主机虽然显示已启用,但ZBX字体是红色的。
且报错如下:

zabbix-Get value from agent failed: cannot connect to [[127.0.0.1]:10050]: [111] Connection refused

意思是agent连接失败

1)查看防火墙

[root@m01 ~]# getenforce
Disabled
[root@m01 ~]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
   Active: inactive (dead)
     Docs: man:firewalld(1)

2)agent是否开启,检查端口10050

[root@m01 ~]# netstat -lntup|grep 1005
tcp        0      0 0.0.0.0:10051           0.0.0.0:*               LISTEN      6173/zabbix_server  
tcp6       0      0 :::10051                :::*                    LISTEN      6173/zabbix_server 

可以看到只有server端口10051开启。因此需要开启agent

[root@m01 ~]# systemctl start zabbix-agent.service 
[root@m01 ~]# systemctl status zabbix-agent.service 
● zabbix-agent.service - Zabbix Agent
   Loaded: loaded (/usr/lib/systemd/system/zabbix-agent.service; disabled; vendor preset: disabled)
   Active: active (running) since Mon 2022-07-04 11:49:31 CST; 7s ago

3)最后检查,ZBX变绿,恢复正常。

你可能感兴趣的:(监控,linux,zabbix)