Closed xtender closed 6 years ago
The error means that Zabbix server can not connect to remote 127.0.0.1:10050 Zabbix agent. 10051 port is Zabbix server dedicated port. Please check our manual.
@dotneft no, if you check your config file https://github.com/zabbix/zabbix-docker/blob/4.0/docker-compose_v2_centos_mysql_latest.yaml you can see that it configured to 10051:
zabbix-server:
image: zabbix/zabbix-server-mysql:alpine-4.0-latest
ports:
- "10051:10051"
@dotneft and as I showed above, I can connect to this port, but zabbix server closes connection without response.
[root@zabbix-server zabbix]# telnet 127.0.0.1 10051
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
Connection closed by foreign host.
@dotneft Could you reopen this issue, please?
It closes, because it is not Zabbix agent port! Please change Zabbix agent IP in host configuration to correct one.
I am having the same issue. You mention that "Zabbix agent IP in host configuration to correct one" however I am not sure which file you are referring to. The docker-compose file or one of the .env_* files.
If I attach to the agent container, and view /etc/zabbix/zabbix_agent.conf, I see Server=zabbix-server. I can then ping zabbix-server from the command line.
Am I still missing something?
@xtender I think the issue is that the agent and server are running in separate containers with separate ips. When running in docker it might make sense to run them with the host network mode and to update the ip in configuration/hosts to the ip of the docker host. There may be a more streamlined way to do this... but zabbix, while distributed in containers isn't really configured out of the box to work with a containerized infrastructure.
@dotneft, I think we can all read the error. The question is why does it arise in the default compose examples? There is work to be done here to make the example work out of the box. Closing the issue just hides that work.
Any solution?
I ended up setting the agent hostname in the container to match the docker host, using host networking mode and sharing the hosts pid namespace with the zabbix-agent. That seems to have gotten something reasonable working.
same issue here
As a workaround, you can open Zabbix, go to "Configuration" -> "Hosts". Edit the "Zabbix Server" entry by setting the "dns name" to "zabbix-agent". Make sure to select the dns button and hit save.
Absolutely correct! Or use different DNS name for Zabbix agent container.
Hi,
There is something wrong with default docker-compose configuration docker-compose_v2_centos_mysql_local.yaml.
It starts fine, but I get "Zabbix agent on Zabbix server is unreachable for 5 minutes".
Port 10051 is open and zabbix server is listening it, but when I try to connect to this port, it closes connection: