Wazuh agent fim module is not working when wazuh-agent service is started in the user data script. The service starts and there's nothing wierd in ossec logs but nothing shows up in the dashboard. Fim starts working after I ssh into the instance and do a systemctl restart wazuh-agent. My user data script looks like this (variable assignments was omitted) :
yum update -y; WAZUH_MANAGER="${WAZUH_WORKER}" WAZUH_REGISTRATION_SERVER="${WAZUH_AUTH}" WAZUH_AGENT_NAME="${AGENT_NAME}" WAZUH_AGENT_GROUP="default" WAZUH_REGISTRATION_PASSWORD="${AUTH_PASSWORD}" yum install -y https://packages.wazuh.com/4.x/yum/wazuh-agent-4.3.9-1.x86_64.rpm; systemctl daemon-reload; systemctl enable wazuh-agent; systemctl start wazuh-agent;
I'm using centralized agent configuration. Not sure if the agent.conf is not getting pulled in user-data since it eventually does get pulled when I ssh into the instance.
The expected result was wazuh agent working normally and sending fim changes to dashboard once they happen. What i got was the fim module did nothing untill wazuh agent service was restart after sshing into the instance