Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Agent controller - Connection refused

Problem

With Checkmk 2.1, we released the new agent controller with a TLS connection. Detailed docs can be found here:

...

In this manual, we will show you how to debug the below error:

...

Image Added

...


Please run the following commands to check the state of the agent controller and the port states:

...

Disable TLS registration on the CMK Server: Properties of host → menu → entry Host → Remove TLS registration


Afterwards Afterward, ss should show xinetd claiming the connection 

...

After installing the agent, the registration is not working and showing the following issue:

...

Image Added

Solution

Please check and verify that the agent controller is running:

Code Block
languagebash
themeRDark
ss -tulpn | grep 6556
 
ps waux | grep cmk-agent-ctl
 
cmk-agent-ctl status
 
systemctl status check-mk-agent.socket
systemctl status cmk-agent-ctl-daemon.service


In that case here, the agent controller is not running because xinetd is running. For the agent controller, systemd is necessary:   https://checkmk.com/werk/13865

If you're using the bakery, you need to create the following rule:

...

Image Added

...

Image Removed


Without the bakery, please follow these steps: https://docs.checkmk.com/latest/en/agent_linux_legacy.html#_systemd

...

Code Block
themeRDark
root@<cmkserver>:~# cmk-agent-ctl register -H <host> -s <checkmk-server> -i <site> -U <username> -p:8000

Solution #2

Add the self-signed certificate to the OS's cert store. Example for Ubuntu:  https://ubuntu.com/server/docs/security-trust-store

...

If you see this error message when trying to work with any subcommand of cmk-agent-ctl, there is probably something wrong in with the file /var/lib/cmk-agent/registered_connections.json.

Solution

First, move the file registered_connections.json to registered_connections.json.bak and re-run the command. If that works, you can start checking the content of the file. If you still need the registration data stored in the file, check the line and column in the error message and try to repair it. If you don't need it anymore, simply delete the file.

Related articles

...