Agent controller - Connection refused
Problem
With Checkmk 2.1 we released the new agent controller with TLS connection. Detailed docs can be found here:
- https://docs.checkmk.com/latest/de/agent_windows.html
- https://docs.checkmk.com/latest/en/agent_windows.html
In that manual, we will show you how to debug the below error:
Please run the following commands to check the state of the agent controller and the port states:
For Linux
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
For Windows
netsh interface ipv4 show excludedportrange protocol=tcp
Solution
For Linux
If the registration is good, but cmk-agent-ctl cannot be started. This might be a bug.
You might then switch to xinetd mode:
apt install xinetd
Disable the systemd services:
systemctl stop check-mk-agent.socket systemctl disable check-mk-agent.socket systemctl stop cmk-agent-ctl-daemon.service systemctl disable cmk-agent-ctl-daemon.service
Install the xinetd service:
/var/lib/cmk-agent/scripts/super-server/1_xinetd/setup deploy /var/lib/cmk-agent/scripts/super-server/1_xinetd/setup trigger
Disable TLS registration on the CMK Server: Properties of host → menu → entry Host → Remove TLS registration
Afterwards ss should show xinetd claiming the connection
ss -tulpn | grep 6556 systemctl status check-mk-agent.socket
Registration with cmk-agent-ctl is not working
Problem
After installing the agent, the registration is not working and showing the following issue:
Solution
Please check and verify that the agent controller is running:
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:
Without the bakery, please follow these steps: https://docs.checkmk.com/latest/en/agent_linux_legacy.html#_systemd
Related articles