【问题标题】:Zabbix proxy - Received empty response from Zabbix AgentZabbix 代理 - 收到来自 Zabbix 代理的空响应
【发布时间】:2015-06-24 05:44:41
【问题描述】:

我正在尝试设置 zabbix 代理。我的网络如下

Zabbix服务器IP:192.168.101.11(内网) Zabbix代理服务器:192.168.102.109(内网) Zabbix 代理:172.1.16.2(外网但可从 102.109 ping 通)

我可以从我的代理机器 ping zabbix 代理 IP。

[root@102_109 ~]# ping 172.1.16.2
PING 172.1.16.2 (172.1.16.2) 56(84) bytes of data.
64 bytes from 172.1.16.2: icmp_seq=1 ttl=64 time=215 ms
64 bytes from 172.1.16.2: icmp_seq=2 ttl=64 time=214 ms
64 bytes from 172.1.16.2: icmp_seq=3 ttl=64 time=214 ms
64 bytes from 172.1.16.2: icmp_seq=4 ttl=64 time=214 ms

我可以从我的 zabbix 服务器连接到 zabbix 代理 -

zabbix_get -k agent.ping -s 192.168.102.109
1

我的 zabbix_proxy.conf 文件(在 102.109 上)如下

ProxyMode=0
Server=192.168.101.11
Hostname=CME_Proxy
LogFile=/tmp/zabbix_proxy.log
DBName=zabbix
DBUser=root
DBPassword=password

在zabbix代理机(172.1.16.2)上配置如下。

EnableRemoteCommands=1
LogFile=/tmp/zabbix_agentd.log
Server=192.168.101.11,192.168.102.109
ServerActive=192.168.101.11,192.168.102.109
Hostname=172.1.16.2
AllowRoot=1

在我的 zabbix 前端,我已将主机配置为由代理 (CME_Proxy) 监控,并且只有一项 (agent.ping)。

我无法从 zabbix 代理获取任何数据。在我的代理机器上,当我运行以下命令时,它返回一个空白值。

zabbix_get -k agent.ping -s 172.1.16.2
<this is blank response>

因此,在主机配置中,zabbix显示错误-

“在 [172.1.16.2] 收到来自 Zabbix Agent 的空响应。假设 该代理因访问权限而断开连接。”

如果我的配置方式正确,有人可以指导我吗?如果不是如何正确地做到这一点。如果您需要更多数据,请告诉我。

谢谢

穆库尔

【问题讨论】:

    标签: zabbix


    【解决方案1】:

    想通了:

    在代理配置文件中,以下参数

    Server=192.168.101.11,192.168.102.109
    ServerActive=192.168.101.11,192.168.102.109 
    

    应该是

    Server=192.168.101.11,172.1.16.1
    ServerActive=192.168.101.11,172.1.16.1
    

    【讨论】:

      【解决方案2】:

      > server 172.1.16.2,zabbix_agentd.conf 部分改动

      • 您需要指定谁有权向代理请求数据(被动检查)。 Server=192.168.102.109 # it will allow connections from proxy ip # ServerActive=192.168.102.109 # comment ServerActive if you won't use active checks
      • 在 Web 界面上(由 CME_Proxy 监控的设置,或您在 192.168.102.109 上的 zabbix_proxy.conf 的主机名中定义的相同)

      >检查通信:和以前一样!

      • 在代理终端 (192.168.102.109): enter code here zabbix_get -k agent.ping -s 172.1.16.2 # It should return 1.

      PS:检查zabbix_proxy.conf中的Hostname,它应该是CME_Proxy,或者和你在web界面定义的一样。

      【讨论】:

        【解决方案3】:
        # FOR step-by-step guide of running latest zabbix version 5.0 follow these links
        # https://blog.zabbix.com/zabbix-docker-containers/7150/
        # https://techexpert.tips/zabbix/monitoring-docker-using-zabbix/
        
        #it's simple just add all zabbix server IPs in zabbix host agent  conf #file like below
        
        
        Server=192.168.101.11,172.1.16.1
        ServerActive=192.168.101.11,172.1.16.1
        
        
        if you ur using zabbix server-agent model using docker containers then while deploying containers specify zabbix server Host/Container IPs which wants to connect to zabbix agent container
        
        Assuming if you wanna deploy zabbix server and agent in the same server running docker containers just run below docker deploy commands 
        
        
        #Zabbix Server Container
        sudo docker run --name zabbix-appliance -p 8080:80 -p 10051:10051 -d -h zabbix-server zabbix/zabbix-appliance
        
        #Zabbix Agent container
        sudo docker run --name=dockbix-agent-xxl   --privileged   -v /:/rootfs   -v /var/run:/var/run -p 10050:10050   -e "ZA_Server=192.168.0.3,172.17.0.1" -e "ZA_ServerActive=192.168.0.3,172.17.0.1"   -d monitoringartist/dockbix-agent-xxl-limited:latest
        
        #Default username and password of zabbix server
        #username: Admin password: zabbix
        # For monitoring docker containers resources import a template from this cloned repository https://github.com/monitoringartist/zabbix-docker-monitoring
        
        

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多