Hi,
I run Checkmk Community (formerly Raw) 2.4.0p32 in a Docker container on an Ubuntu 22.04 host. The Checkmk container is named check-mk-raw. With this instance I monitor both the Ubuntu host and all the Docker containers running on it.
The Ubuntu host itself is monitored as host.docker.internal. Docker containers are monitored as separate piggyback hosts. All container hosts are configured as:
-
address_family: no-ip -
agent: no-agent -
piggyback: auto-piggyback -
parent:
host.docker.internal
The Docker agent plugin is installed on the Ubuntu host:
/etc/check_mk/docker.cfg
/usr/lib/check_mk_agent/plugins/mk_docker.py
My /etc/check_mk/docker.cfg used:
[DOCKER]
skip_sections: docker_node_disk_usage,docker_node_images
container_id: name
base_url: unix://var/run/docker.sock
persist_period_node_disk_usage: 9
This way I saw tons of the following errors in the Docker daemon logs:
exec: "check_mk_agent": executable file not found in $PATH
All of my containers (but the check-mk-raw container) do not have the Checkmk agent installed, so this error makes sense technically.
So I added docker_container_agent to skip_sections in /etc/check_mk/docker.cfg. After that, a manual agent fetch for host.docker.internal succeeded and no new check_mk_agent Docker exec errors appeared in the Docker journal during the immediate test.
However, this also created a side effect: After skipping docker_container_agent globally, most services in the check-mk-raw host in Checkmk became stale/unknown, which seems logical because Checkmk no longer receives the container-internal agent output via mk_docker.py.
My question:
What is the recommended Checkmk way to handle this situation?
I would like:
-
docker_container_agentskipped for all normal application containers, because they do not containcheck_mk_agent. -
But still monitor the
check-mk-rawcontainer with its internal Checkmk agent output. -
Ideally without causing
mk_docker.pyto trydocker exec check_mk_agentinside every other container every time the Docker plugin runs.
Is there an official or recommended solution for this? In particular, is there a supported way to enable docker_container_agent only for selected containers? Or any other idea?
Thanks!