Hello,
CMK version: Checkmk Community (formerly Raw) 2.5.0p11
OS version: Docker Container checkmk/check-mk-community:2.5.0-latest
I’m running a Checkmk Container on host1. The CheckMk instance is working fine and monitoring successfully other Hosts/Services. I want to monitor Docker Services on host2.
Therefore I setup the Legacy Agent via SSH on host2, installed the Docker Plugin and the python3-docker dependencies. I further configured the /etc/check_mk/docker.cfg as follows:
[DOCKER]
skip_sections: docker_node_disk_usage
container_id: name
The integration seems to work, I get
Docker containers - Containers: 98, Running: 26, Paused: 0, Stopped: 72
The container names in Docker Swarm are formatted like <container-name>.<instance-id>.<random> so it will become my-container.1.2ts5bccy9vkd1b4kspkuo0x6t. So I added a Host name translation for piggybacked hosts , as a regex ([a-z_\-]*)(.*) → \1. So I get only the container name.
I also configured the piggyback service and I get the running containers on my host1 in tmp/check_mk/piggyback/<container-name>. That’s working fine.
However, if I add now the container name as a new host into checkmk, I’ll get the services discovered, but the host stays DOWN.
Found data from multiple Docker nodes - see service details for more information
As the Services are tied to one specific node, I can exclude, that there are many Docker nodes.
If I change the the setting in docker.cfg to use the container id it works. However, this is not a feasable solution, as I have to change the container name, everytime I restart the service.
If I don’t use the Host name translation for piggybacked hosts the the folders will be named again my-container.1.2ts5bccy9vkd1b4kspkuo0x6t which does not bring any advantage over the container ID.
I assume, all old containers of this services are all merged together in one output file. Which is my-container.aow738t5fgaw7o3gt5, my-container.1.2ts5bccy9vkd1b4kspkuo0x6t and my-container.9y8736g4aowwo3a5f are all merged to my-container leading to confusion within checkmk.
I learned, that the Enterprise Version has the feature DND. Of course this would be probably a solution, but I’m using checkmk for my homelab and therefore no budget for enterprise grade
.
Is there no other way, to monitor Docker containers which are running in a Swarm with checkmk or am I missing something?
Google and this forum didn’t bring any results. Happy for any good hints, help or idea, how to solve this. Thanks a lot!
