Zabbix Server set up in Docker to Zabbix agent communication settings on the host

Asked 1 years ago, Updated 1 years ago, 88 views

I am using CentOS 7.
I set up Zabbix Server in Docker.

 sudo docker run-d --restart=always-eLANG=ja_JP.UTF-8 --private --name zabb
ix-hzabbix-p 80:80-p 10051:10051 docker.io/centos/sbin/init

After setup, you can monitor switch traffic using SNMP.

Failed to install Zabbix Agent on server host.Same server with Docker setup.

The configurations are as follows:

·Host server IP address: 192.168.1.130
·Internal IP address of the Docker container (Agent): 172.17.0.4

The /etc/zabbix/zabbix_agentd.conf setting for the host-side agent is

Server=192.168.1.130

says .

Server side monitors host side agent

192.168.1.130 port 10050

Configuring the .

However, the Agent on the host cannot be monitored and
In /var/log/zabbix/zabbix_agentd.log,

 13935:20170415:153500.521 failed to accept an incoming connection: connection from "172.17.0.4" rejected, allowed hosts: "192.168.1.130"

You are getting an error.

Apparently, the server in zabbix_agentd.conf is allowed IP, which changes the IP address every time you recreate the docker.

container:Zabbix Server->192.168.1.130:port10050->[host:Zabbix Agent]
※ The Source IP to the Zabbix Agent is 192.168.1.130 or 127.0.01

I had an image of , but it looks like the local IP of the container.

How do I set this container so that I don't have to change Server or zabbix_agentd.conf even if I recreate it?

Please let me know if you know.

docker zabbix

2022-09-30 21:23

1 Answers

I was worried about the same problem, but I solved it using the following method.
1.Create a bridge network on the Docker host
2. When starting the Zabbix Server container, use the network created in 1 and fix the IP address
3. Write the IP address specified in 2 on the Server in /etc/zabbix/zabbix_agentd.conf


2022-09-30 21:23

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.