Hello Fawwas,
Thank you for sharing your issue with us!
Are you trying to configure the <localfile> sections for command monitoring through the centralized configuration files (agent groups' agent.conf) instead of adding them locally in the agent machines' ossec.conf file? You can use the centralized configuration to distribute this setting across multiple monitored endpoints. However, remote commands are disabled by default for security reasons in the agent machines and have to be explicitly enabled on each agent locally to allow this setting to work.
To enable remote command execution, you need to add the following line to the /var/ossec/etc/local_internal_options.conf file on the agent side locally.
wazuh_command.remote_commands=1
After adding this local option, you need to restart the wazuh-agent to make this change effective.
Other than this, all other configurations and steps in the blog can be performed from the Wazuh Server end.
I hope it helps. Please let us know if you have any further query here.