Auto registration declined

CMK version: 2.4.0p11
OS version: 1.7.12

Error message: Host name conflict

Hello I created a rule for automatic host registration and creation in my distributed environment.

For one site the rule has no issues and works fine without my intervention, for the other site I am testing tho it does not work.

The only clue I am given is in Declined requests in the agent registration section which says:

Host Name conflict.

are you running on a container or an appliance?

One possibility is:

Stale registration / UUID conflict

If the host was previously registered (either manually or through a prior auto-registration attempt), leftover registration data can cause a “Host name conflict”. This can exist on both sides — the agent host and the Checkmk server.

On the agent host, check and clean up:

# Check current registration status
cmk-agent-ctl status

# If there are stale connections, remove them:
cmk-agent-ctl delete-all

# Verify the connections file is clean:
cat /var/lib/cmk-agent/registered_connections.json

On the Checkmk remote site (as site user), check for orphaned entries:

# Check for leftover agent-receiver data:
ls -la ~/var/agent-receiver/received-outputs/

# Check for old deployment data:
ls -la ~/var/check_mk/agent_deployment/ | grep -i <hostname>

# If you find orphaned entries for the host, remove them:
rm ~/var/agent-receiver/received-outputs/<UUID-of-old-registration>
rm ~/var/check_mk/agent_deployment/<hostname>

After cleaning up both sides, restart the agent controller on the host and let it re-register:

systemctl restart cmk-agent-ctl-daemon

Then check the “Declined requests” section again on the Checkmk server.

KR Bernd