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.