'Zabbix on docker-compose don't start zabbix-agent

I have used docker-compose based zabbix version 4.x in the past.

When I started the environment I could count more than 5 containers, including zabbix-agent.

I am now trying to start versions 5.0, 5.2 and 5.4 but it always happens to me that

  1. the contaniers started are only 3 (much less than those indicated in the yaml file)
  2. the container with zabbix agent is not running and listening.

Furthermore on docker-compose up I have this errors

WARNING: The following deploy sub-keys are not supported and have been ignored: resources.reservations.cpus
WARNING: The following deploy sub-keys are not supported and have been ignored: resources.reservations.cpus
WARNING: The following deploy sub-keys are not supported and have been ignored: resources.reservations.cpus
WARNING: The following deploy sub-keys are not supported and have been ignored: resources.reservations.cpus
WARNING: The following deploy sub-keys are not supported and have been ignored: resources.reservations.cpus
WARNING: The following deploy sub-keys are not supported and have been ignored: resources.reservations.cpus
WARNING: The following deploy sub-keys are not supported and have been ignored: resources.reservations.cpus
WARNING: The following deploy sub-keys are not supported and have been ignored: resources.reservations.cpus
....
 Zabbix agent item "system.cpu.intr" on host "Zabbix server" failed: first network error, wait for 15 seconds
 Zabbix agent item "vm.memory.size[pavailable]" on host "Zabbix server" failed: another network error, wait for 15 seconds

In addition, I have to use active checks with some servers, because the VMs are behind a NAT and cannot be reached by the server: on the documentation I saw that in the web interface you can choose between active or passive agent but on my server I only have the voice "agent" without passive or active.

For the Zabbix agent, there is a choice between ‘Zabbix agent (passive)’ and ‘Zabbix agent (active)’.

I m on centos 7, Docker version 1.13.1, build 7d71120/1.13.1, docker-compose version 1.29.2, build 5becea4c



Solution 1:[1]

I don't know if you still having this problem, but the solution is to run the docker compose using the 'all' profile:

docker-compose --profile all up

Starting with docker-compose 1.28.0 you have the option to run some services from the docker file. You can have multiple profiles to run, so in the new zabbix compose files there is a profile called 'full' and 'all'.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Antoxic