Installing mk_docker plugin - docker.py not found

Dear community,

I am new to checkmk (running 1.6.0p10) and one of my first systems I would like to monitor is my docker host. For this, I followed the plugin instructions and I installed the agent (1.6.0p10) on my docker host (which is reporting back just fine), then installed the mk_docker plug-in, but when I am discovering services for this host, I am stuck at the following error:

Critical - Docker node info - Error: mk_docker requires the docker library. Please install it on the monitored system (pip install docker).(!!)

I did install the plugin dependencies as follows:

sudo -s
pip uninstall docker-py docker
pip install docker

When I run the tests on this box locally with the following commands, it picks up my containers just fine without any issues:

python
>>> import docker
>>> docker.version
'4.2.0'

check_mk_agent

When I discover the services from inside the checkmk GUI, I am getting the above error message. This makes me wonder whether I have installed the docker.py library either on the wrong system, inside the wrong location or for the wrong user.

I also have python versions 2 and 3 running on my docker host (standard on Ubuntu 18). The default being python 2. Could that interfere?

The docker host system is an Ubuntu 18.04 box.

Can you point me into the right direction to get this working?

Can you try to install it also for python3 ? It might be the issue. From your info you just installed it for python2

I got it working now with the following steps on the docker host (notice the -H flag):

sudo -H -s
pip install docker
pip3 install docker
shutdown -r now

Thanks for pointing me in the right direction @tavanez :slight_smile:

1 Like