Hi Khul,
What could have happened is that the agents momentarily lost communication with the manager, this generates that after 5 consecutive failed connection attempts the agent requests a new key and this causes the agent to change its ID.
In version 4.3 a new functionality was added to control these cases, so that depending on the configuration the re-registration of the agents will be allowed/blocked, this functionality is configured through the <force> block.
The new block is <force> which is configured inside <auth> (manager)
<auth>
…
<force>
<enabled>yes</enabled>
<disconnected_time enabled="yes">1h</disconnected_time>
<after_registration_time>1h</after_registration_time>
<key_mismatch>yes</key_mismatch>
</force>
…
</auth>
Enabled: Toggles whether or not to force the insertion of an agent if there is a duplicate name or IP address. This will remove the old agent with same name or IP address.
disconnected_time: This option, when enabled, specifies that the replacement will be performed only for agents that have been disconnected longer than the value configured in the setting. This option should be disabled to replace any agent regardless of its state.
after_registration_time: Specifies that the agent replacement will be performed only when the time passed since the agent registration is greater than the value configured in the setting.
key_mismatch: This option defines that the agent replacement occurs when the key held by the agent is different from the one registered by the manager.
You can find detailed information about the force block in this link:
https://documentation.wazuh.com/current/user-manual/reference/ossec-conf/auth.html#force
I hope it helps.
Best regards,
Pedro Nicolas.