Hi, thanks for using Wazuh.
Based on the logs displayed, it looks like there is a naming conflict or a network problem.
Name conflict: as we can see there is already an agent registered with the name "mail" so when you try to register another agent with the name "mail" it fails:
2022/01/21 12:51:33 wazuh-authd: INFO: Duplicate name 'mail' (003).
In this case we must make sure that there is only one agent with the name "mail", if you are sure of this we can remove the agent previously registered with the name "mail" and register it again, for this we follow the following steps:
Stop the agent:
On the agent side we execute:
/var/ossec/bin/wazuh-control stop
Delete the old agent:
On the manager side we execute:
/var/ossec/bin/manage_agents -r 003
Note that 003 is the ID related to the agent with name "mail" previously registered.
Register the agent again:
On the agent side we execute:
/var/ossec/bin/agent-auth -m MANAGER_IP -A mail
Then, start the agent:
/var/ossec/bin/wazuh-control start
Network problem:
Please have in mind that Wazuh uses by default ports 1515/TCP for registration and 1514/TCP for communication.
I may suggest you to check if you have a connection through these ports (check firewall rules ...)
In case some of these ports are closed, open them and then, restart both wazuh manager and agent.
Also make sure that the agent and the manager use the same communication protocol.I hope it helps.
Best regards, Pedro Nicolas.