Closed hallux4 closed 1 year ago
Zabbix server does not use 10050 port, it uses 10051 port. Only Zabbix agent uses 10050 port.
Sorry if I wasn't clear. When I wrote "server", I was referring to the VM that host the zabbix docker container and the zabbix-agent2.service (systemd).
https://www.zabbix.com/documentation/current/en/manual/quickstart/host
The agent that I define for my new host (new zabbix server) can't connect properly (from the container to the host). the connection works from the old zabbix server though (same agent, same config, different VM).
Firewall? Check telnet / nc.
it was indeed a firewall problem.
I restarted the zabbix-server container as root for debugging.
apt update
apt install netcat tcpdump telnet net-tools
# on the host :
ufw disable
nc -l -vv -p 5000
Listening on 0.0.0.0 5000
...
# on the container:
nc NEW_Zabbix_server 5000
# it then said :
Connection received on 172.16.239.5 4772
ufw enable
ufw allow from 172.16.239.0/24
I naively believed that the docker container outgoing connection directed to the host would be considered as "local connection" :'(
after updating the zabbix-agent2.conf
Server=172.16.239.5,OLD_Zabbix_server #passive checks
ServerActive=NEW_Zabbix_server,OLD_Zabbix_server #active checks
...
systemctl restart zabbix-agent2.service
tail -f
Everything worked a lot better.
thanks for your help.
so the problem is fixed? :-)
everything is ok, thanks
SUMMARY
Hello
We currently have 2 zabbix instances.
OLD_Zabbix_server => systemd 4.4 NEW_Zabbix_server => docker 6.4
I try to migrate our OLD_Zabbix_server from a VM with systemd services toward a NEW_Zabbix_server running on Docker. Database has been copied and upgraded to avoid redeclaring all the hosts and configuration.
When I use the zabbix-agent2 container, I can see the Zabbix server availability (ZBX status green <=> zabbix-agent:10050). None of the other hosts zabbix-agents seems to work properly.
If I shutdown the zabbix-docker-agent2 on my NEW_Zabbix_server host and start a zabbix service with systemd. I replaced zabbix-agent:dns with NEW_Zabbix_server:ip In the web interface I get this message.
no firewall rules blocking the way.
OS / ENVIRONMENT / Used docker-compose files
NEW_Zabbix_server : Debian 12.1 Agent: zabbix_agent2 (Zabbix) 6.4.6 - Revision 52b7e2cb506 22 August 2023 image: zabbix/zabbix-server-mysql:ubuntu-6.4-latest image: zabbix/zabbix-web-apache-mysql:ubuntu-6.4-latest image: zabbix/zabbix-java-gateway:ubuntu-6.4-latest image: zabbix/zabbix-snmptraps:ubuntu-6.4-latest image: mysql:8.0
CONFIGURATION
zabbix-agent2 conf
Docker compose
env_vars
In the NEW_Zabbix_server log file /var/log/zabbix/zabbix_agent2.log OLD_Zabbix_server get updates
NEW_Zabbix_server get nothing
I also tried all of the above with 172.16.239.1 (host gateway on backend network).
Same result.
I don' t understand why only the OLD_Zabbix_server get a green status on ZBX availability while interrogating the NEW_Zabbix_server' s agent.
I'm very new to Zabbix, and not very experienced with Docker. Is there something obvious that I do wrong ?
Any help is welcome. Thanks you.