Answer the question
In order to leave comments, you need to log in
Why is zabbix-agent not connecting to Docker?
Started learning Docker.
I want to set up a Zabbix monitoring server on containers.
The server itself is working, connected network equipment, but the server itself where Zabbix is installed cannot be connected
Error "Get value from agent failed: cannot connect to [[127.0.0.1]:10050]: [111] Connection refused"
I create containers as follows:
sudo docker run -d \
--name zabbix-postgres \
--network zabbix-net \
-v /var/lib/zabbix/timezone:/etc/timezone \
-v /var/lib/zabbix/localtime:/etc/localtime \
-e POSTGRES_PASSWORD=zabbixpass \
-e POSTGRES_USER=zabbix postgres:alpine
sudo docker run \
--name zabbix-server \
--network zabbix-net \
-v /var/lib/zabbix/alertscripts:/usr/lib/zabbix/alertscripts \
-v /var/lib/zabbix/timezone:/etc/timezone \
-v /var/lib/zabbix/localtime:/etc/localtime \
-p 10051:10051 -e DB_SERVER_HOST="zabbix-postgres" \
-e POSTGRES_USER="zabbix" \
-e POSTGRES_PASSWORD="zabbixpass" \
-d zabbix/zabbix-server-pgsql:alpine-latest
sudo docker run \
--name zabbix-web \
-p 80:8080 -p 443:8443 \
--network zabbix-net \
-e DB_SERVER_HOST="zabbix-postgres" \
-v /var/lib/zabbix/timezone:/etc/timezone \
-v /var/lib/zabbix/localtime:/etc/localtime \
-e POSTGRES_USER="zabbix" \
-e POSTGRES_PASSWORD="zabbixpass" \
-e ZBX_SERVER_HOST="zabbix-server" \
-e PHP_TZ="Asia/Yekaterinburg" \
-d zabbix/zabbix-web-nginx-pgsql:alpine-latest
sudo docker run \
--name zabbix-agent \
--restart=always \
-e ZBX_HOSTNAME="Zabbix-server" \
-e ZBX_LISTENPORT="10050" \
-p 10050:10050 \
-e ZBX_SERVER_HOST="127.0.0.1,localhost" \
-d zabbix/zabbix-agent:alpine-latest
Answer the question
In order to leave comments, you need to log in
I turned it off in my place (there can be nothing interesting there), but I installed agent 2 on the Host machine. Actually, he monitors all containers.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question