How to run Zabbix Agent2 in a container to monitor the host's network interfaces?

When Zabbix agent2 is run in a container in the most basic way it is not able to monitor the network interfaces AND bridges of the Docker host. Also providing the Docker socket to the container and running it as privileged does not help.

Does someone know how to set up the agent2 container so that the Docker host’s network interfaces AND bridges are monitored by agent2 (not the network interface of the docker container!)?

Background: unraid server use a bridge br0 to allow VMs to receive an IP address via DHCP from the network. The unraid server’s IP is bound to the bridge br0, not to he actual network interface. The agent2 would need to discover the bridge to make it visible.

I found a solution.

The reason that the container does not see the host interfaces is that the container runs in network bridge mode.

If the container runs in network host mode it does see all interfaces (the actual interface name filtering can be changed in the LLD macros).

Case closed.

2 Likes