Zabbix proxy - Received empty response from Zabbix Agent

27.6k views Asked by At

I am trying to setup zabbix proxy. My network is as below

Zabbix server IP: 192.168.101.11 (internal network) Zabbix proxy server: 192.168.102.109 (internal network) Zabbix agent: 172.1.16.2 (outside network but pingable from 102.109)

I can ping the zabbix agent IP from my proxy machine.

[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

I can connect to the zabbix proxy from my zabbix server -

zabbix_get -k agent.ping -s 192.168.102.109
1

My zabbix_proxy.conf file (on 102.109) is as below

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

And on the zabbix agent machine (172.1.16.2) the configuration is as below.

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

On my zabbix front end, I have configured the host as monitored by proxy (CME_Proxy) and there is only 1 item (agent.ping).

I am not able to get any data from the zabbix agent. From my proxy machine, when I run the following command, it returns a blank value.

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

Due to this, in the host configuration, zabbix shows error -

"Received empty response from Zabbix Agent at [172.1.16.2]. Assuming that agent dropped connection because of access permissions."

Can someone please guide me if the way I have configured is correct? If not how to do this correctly. If you need additional data please let me know.

Thank you

Mukul

3

There are 3 answers

0
Mukul Jain On

Figured it out:

In the agent config file, the following parameters

Server=192.168.101.11,192.168.102.109
ServerActive=192.168.101.11,192.168.102.109 

should have been

Server=192.168.101.11,172.1.16.1
ServerActive=192.168.101.11,172.1.16.1
0
devops-admin On
# 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

0
gph On

> server 172.1.16.2, some changes in zabbix_agentd.conf

  • you need specified who will have permission to request the data to agent (passive checks). 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
  • at the web interface (set monitored by: CME_Proxy, or the same you defined in Hostname at zabbix_proxy.conf on 192.168.102.109)

> check communication: as you did before!

  • at the proxy terminal (192.168.102.109): enter code here zabbix_get -k agent.ping -s 172.1.16.2 # It should return 1.

PS: check Hostname in the zabbix_proxy.conf, it should be CME_Proxy, or the same you defined at web interface.