CMK version:
checkmk/check-mk-raw:2.4.0-latest (Docker) OS version:
Error message:
checkmk-agent does not include mk_docker.py information. Output of “cmk --debug -vvn hostname”: (If it is a problem with checks or plugins)
I installed checkmk 2.4.0 RAW docker container recently (fresh install). The checkmk agent works properly. My docker install (from image: checkmk/check-mk-raw:2.4.0-latest)
did not have the Python module docker. So, I ran: “sudo apt install -y python3-docker”.
I also created the file /etc/check_mk/docker.cfg containing:
container_id = name
name_prefix = docker1
socket = /var/run/docker.sock
Then, I installed the mk_docker.py plug-in. I don’t get any docker-related services. So somehow, mk_docker.py is not providing data. Any suggestions? I am using checkmk v2.4.0 RAW?
You don’t need to do this inside your container. The mk_docker.py needs to be installed with the CMK agent on the docker host not inside the container.
Inside the manual you find this directly under point 2.1
Sorry, I may have misspoken. To clarify, I installed the Checkmk agent and mk_docker.py in the docker VM (not inside the Checkmk container). The Checkmk agent works perfectly, but I got no new Docker services. So, I’m wondering if maybe there’s something different in Checkmk 2.4 RAW compared to previous versions (e.g. 2.3 or earlier), and if anyone can confirm the mk_docker.cfg works for them in 2.4 RAW.
There is nothing different - it should be possible to execute the mk_docker.py manually as root to see if there is valid output.
On my systems mk_docker.py is working as i expect it with 2.4.
Thanks. The version of mk_docker.py I have is 2.4.0p13. When I run /usr/lib/check_mk_agent/plugins/mk_docker.py from the command line, it runs just fine. I can see the docker info. But somehow, checkmk agent isn’t or can’t run mk_docker.py. So, when I go to checkmk and try to discover new docker services in my docker VMs, it doesn’t find any new docker services.
I also noticed that if I manually run:
/usr/lib/check_mk_agent/plugins/mk_docker.py | head -n 40
then I get a bunch of BrokenPipeError messages, which makes me wonder if the multiprocessing of this new version of mk_docker.py is not working properly when checkmk-agent calls mk_docker.py.
I wonder if there’s an older version of mk_docker.py that I can try (that doesn’t have multiprocessing)… or maybe just something in my environment that’s having issues…
If you say that mk_docker.py runs normally i would take a look at the agent output of your docker host. There you should see some docker sections and also the piggyback hostnames as headers. Every piggyback header starts with 4 < and ends with 4 >.
To test the agent you can also do a “cmk-agent-ctl dump” to get the current agent output on the docker host itself.
Inside your CMK site you can have a look at the folder “~/tmp/check_mk/piggyback/” if there are some folders existing with the names of your docker containers.