Hi,
i am running checkMK as docker: check-mk-raw:2.0.0-latest which is
2.0.0p11 (CRE) right now.
I am using “Individual program call instead of agent access”
Command line to execute is:
ssh -i /omd/sites/cmk/.ssh/id_rsa -T root@$HOSTADDRESS$
While on cli shell this command will work:
ssh -i /omd/sites/cmk/.ssh/id_rsa -T root@10.1.2.3 | head
<<<check_mk>>>
Version: 2.1.0i1
AgentOS: linux
Hostname: storage1.local
AgentDirectory: /etc/check_mk
DataDirectory: /var/lib/check_mk_agent
SpoolDirectory: /var/lib/check_mk_agent/spool
PluginsDirectory: /usr/lib/check_mk_agent/plugins
LocalDirectory: /usr/lib/check_mk_agent/local
<<<labels:sep(0)>>>
inside the UI, it will fail with:
Agent exited with code 2:
Another server, with same OS ( archlinux ) will work fine in cli and UI ( but
<<<check_mk>>>
Version: 2.0.0p11
AgentOS: linux
Hostname:
AgentDirectory: /etc/check_mk
DataDirectory: /var/lib/check_mk_agent
SpoolDirectory: /var/lib/check_mk_agent/spool
PluginsDirectory: /usr/lib/check_mk_agent/plugins
LocalDirectory: /usr/lib/check_mk_agent/local
<<<df>>>
( while for some reason the “Hostname” will be shown empty here )
I tried to get more information about whats it’s issue by executing:
sudo -u cmk /opt/omd/versions/2.0.0p11.cre/bin/python3 /opt/omd/sites/cmk/bin/cmk --debug -nv storage1.local
from inside of the container. But just got:
Check_MK can be used only as site user.
During running the tests the docker container will run:
cmk 130799 83.6 0.5 99240 85912 ? S 07:53 0:02 python3 /omd/sites/cmk/bin/check_mk --automation diag-host storage1.local agent 10.1.2.3 6556 1 5 5
cmk 130817 0.0 0.0 2392 700 ? S 07:53 0:00 /bin/sh -c ssh -p 2211 -i /omd/sites/cmk/.ssh/id_rsa -T root@10.1.2.3
cmk 130820 3.0 0.0 13072 5876 ? S 07:53 0:00 ssh -p 2211 -i /omd/sites/cmk/.ssh/id_rsa -T root@10.1.2.3
running the ssh command manually ( with " | head") from inside of the docker container will work and output:
<<<check_mk>>>
Version: 2.1.0i1
AgentOS: linux
Hostname: storage1.local
AgentDirectory: /etc/check_mk
DataDirectory: /var/lib/check_mk_agent
SpoolDirectory: /var/lib/check_mk_agent/spool
PluginsDirectory: /usr/lib/check_mk_agent/plugins
LocalDirectory: /usr/lib/check_mk_agent/local
<<<labels:sep(0)>>>
So as we see:
Version: 2.1.0i1 ( not working )
vs.
Version: 2.0.0p11 ( working )
So in case you run into the same issue, now you know that at least version 2.1.0i1 that i got yesterday from the official github repository:
https://raw.githubusercontent.com/tribe29/checkmk/master/agents/check_mk_agent.linux
is buggy. Choose another version and it will work
Greetings
Oliver