docker-compose 上的 Zabbix 不启动 zabbix-agent

use*_*473 6 zabbix agent docker-compose

我过去使用过基于 docker-compose 的 zabbix 版本 4.x。

\n

当我启动环境时,我可以数出超过 5 个容器,其中包括 zabbix-agent。

\n

我现在正在尝试启动版本 5.0、5.2 和 5.4,但我总是遇到这样的情况

\n
    \n
  1. 启动的容器只有 3 个(比 yaml 文件中指示的要少得多)
  2. \n
  3. 带有zabbix代理的容器没有运行和监听。
  4. \n
\n

此外,在 docker-compose up 上我有这个错误

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

此外,我必须对某些服务器使用主动检查,因为虚拟机位于 NAT 之后,服务器无法访问:在文档中我看到,在 Web 界面中,您可以在主动或被动代理之间进行选择,但在我的服务器上我只有声音“代理”,没有被动或主动。

\n
For the Zabbix agent, there is a choice between \xe2\x80\x98Zabbix agent (passive)\xe2\x80\x99 and \xe2\x80\x98Zabbix agent (active)\xe2\x80\x99.\n
Run Code Online (Sandbox Code Playgroud)\n

我在centos 7上,Docker版本1.13.1,构建7d71120/1.13.1,docker-compose版本1.29.2,构建5becea4c

\n

小智 7

我不知道你是否仍然遇到这个问题,但解决方案是使用“all”配置文件运行 docker compose:

docker-compose --profile all up
Run Code Online (Sandbox Code Playgroud)

从 docker-compose 1.28.0 开始,您可以选择从 docker 文件运行某些服务。您可以运行多个配置文件,因此在新的 zabbix compose 文件中,有一个名为“full”和“all”的配置文件。