Cmk-agent-ctl register error when running checkmk as docker container

CMK version: 2.1.0p17.cre
OS version: Ubuntu LTS 22.04

Error message: ERROR [cmk_agent_ctl] Something seems wrong with the agent socket (/run/check-mk-agent.socket), aborting

Output of “cmk --debug -vvn hostname”: cmk: command not found (If it is a problem with checks or plugins)

I’m facing the same issue (and also running checkmk raw in a Docker container) on a X86_64 Debian Bullseye host.

Inside the container:

root@9529f647cd27:/# omd version
OMD - Open Monitoring Distribution Version 2.1.0p17.cre
root@9529f647cd27:/# omd sites
SITE             VERSION          COMMENTS
cmk              2.1.0p17.cre     default version 
root@9529f647cd27:/# omd status
Doing 'status' on site cmk:
agent-receiver: running
mkeventd:       running
rrdcached:      running
npcd:           running
nagios:         running
apache:         running
redis:          running
crontab:        running
-----------------------
Overall state:  running

root@9529f647cd27:/# ping acorn3
PING acorn3.localdomain (192.168.1.90) 56(84) bytes of data.
64 bytes from acorn3.localdomain (192.168.1.90): icmp_seq=1 ttl=64 time=0.058 ms
64 bytes from acorn3.localdomain (192.168.1.90): icmp_seq=2 ttl=64 time=0.046 ms
^C
--- acorn3.localdomain ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1008ms
rtt min/avg/max/mdev = 0.046/0.052/0.058/0.006 ms
root@9529f647cd27:/# 

On the Docker host

hbarta@acorn3:~$ ls -l /run/check-mk-agent.socket
s-w-r----- 1 cmk-agent cmk-agent 0 Dec  6 12:07 /run/check-mk-agent.socket
hbarta@acorn3:~$ docker version
Client:
 Version:           20.10.5+dfsg1
 API version:       1.41
 Go version:        go1.15.15
 Git commit:        55c4c88
 Built:             Mon May 30 18:34:49 2022
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server:
 Engine:
  Version:          20.10.5+dfsg1
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.15.15
  Git commit:       363e9a8
  Built:            Mon May 30 18:34:49 2022
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.4.13~ds1
  GitCommit:        1.4.13~ds1-1~deb11u2
 runc:
  Version:          1.0.0~rc93+ds1
  GitCommit:        1.0.0~rc93+ds1-5+deb11u2
 docker-init:
  Version:          0.19.0
  GitCommit:        
hbarta@acorn3:~$ uname -a
Linux acorn3 5.10.0-19-amd64 #1 SMP Debian 5.10.149-2 (2022-10-21) x86_64 GNU/Linux
hbarta@acorn3:~$ dpkg -l check-mk-agent
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
+++-==============-============-============-=================================
ii  check-mk-agent 2.1.0p17-1   all          Checkmk Agent for Linux
hbarta@acorn3:~$ systemctl status check-mk-agent-async
● check-mk-agent-async.service - Checkmk agent - Asynchronous background tasks
     Loaded: loaded (/lib/systemd/system/check-mk-agent-async.service; enabled; vendor preset: enabled)
     Active: active (running) since Tue 2022-12-06 12:07:25 CST; 3 days ago
   Main PID: 3205472 (check_mk_agent)
      Tasks: 2 (limit: 19176)
     Memory: 3.6M
        CPU: 6min 49.742s
     CGroup: /system.slice/check-mk-agent-async.service
             ├─1345903 sleep 60
             └─3205472 /bin/bash /usr/bin/check_mk_agent
hbarta@acorn3:~$ systemctl --version
systemd 247 (247.3-7+deb11u1)
+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +ZSTD +SECCOMP +BLKID +ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-hierarchy=unified
hbarta@acorn3:~$ cmk-agent-ctl --version
cmk-agent-ctl 2.1.0p17
hbarta@acorn3:~$ 

Following the instructions

Att https://docs.checkmk.com/master/en/agent_linux.html?lquery=cmk_agent_ctl I find

hbarta@acorn3:~$ ss -tulpn | grep 6556
tcp   LISTEN 0      4096               *:6556             *:*          
hbarta@acorn3:~$ 

It seems that the agent is not listening on the socket. Can this be fixed? Or is the only option to run the agent in legacy mode? https://docs.checkmk.com/master/en/agent_linux_legacy.html

If I try to run the command (on the host, with checkmk in the Docker container and mapped to port 8000) I get

hbarta@acorn3:~$ sudo cmk-agent-ctl register --hostname acorn3 --server acorn3:8000 --site cmk --user cmkadmin
Attempting to register at acorn3:8000/cmk. Server certificate details:

ERROR [cmk_agent_ctl] the handshake failed: error:1408F10B:SSL routines:ssl3_get_record:wrong version number:ssl/record/ssl3_record.c:331:

Caused by:
    0: error:1408F10B:SSL routines:ssl3_get_record:wrong version number:ssl/record/ssl3_record.c:331:
    1: error:1408F10B:SSL routines:ssl3_get_record:wrong version number:ssl/record/ssl3_record.c:331:
hbarta@acorn3:~$

Any help resolving this is most welcome.

Thanks!

I believe I may have this exactly same issue. Ubuntu 20/04 running checkmk in docker. Trying to register a proxmox host and getting the same ssl errors you are.

Referring to my previous post, the command ss -tulpn | grep 6556 needs to be run as root. When I originally posted this, I knew even less about Checkmk than I do now.

I’m having another go at running this in a Docker container on another host (e.g. installing on the “prod” host on my home LAN so I can shut down the test host.)

Incidentally, I never did get this working in a Docker container satisfactorily. I wound up installing in a VM instead and that seemed to work fine, albeit at the cost of some additional resources.

It looks like there were several problems mixed up here.

  • The initial post suggest an issue with the UNIX socket, the Checkmk agent uses internally
  • Then I see mentions of TLS issues
  • And someone threw docker in

As the initial poster never replied, can you outline your issue in a little more detail?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.