Hi Alex!
Thanks for reaching out.
Have you already given the script the right permissions? You would do that with:
chmod 750 /var/ossec/etc/shared/script.sh
chown root:wazuh /var/ossec/etc/shared/script.sh
On the agent side.
It is also a good idea to enable archives by switching logall_json to "yes" on your manager's /var/ossec/etc/ossec.conf and then restarting the wazuh-manager service.
This would allow you to see if the output from your script is properly getting retrieved in case your decoders/rules are not properly matching it.
Let me know if this helped.
Regards,
Federico