I recommend you check this documentation about Virustotal integration working with FIM:
https://documentation.wazuh.com/current/user-manual/capabilities/virustotal-scan/integration.html?highlight=virustotal#use-case-scanning-a-file
The integration is triggered when a file is added/removed/edited in the directories monitored by syscheck. You will see in alerts.json a syscheck alert and then a Virustotal alert.
To further troubleshoot the exit code 1, change the debug level for wazuh_modules.debug in the
/var/ossec/etc/internal_options.conf file to 2. e.g., wazuh_modules.debug=2 for modules.
After modifying the debug setting, restart the Wazuh manager to apply the changes:
`systemctl restart wazuh-manager`.
The /var/ossec/logs/ossec.log file will show debug information about the Virustotal module. You can filter for it with this command `grep virustotal /var/ossec/logs/ossec.log`
Another option is to troubleshoot VT connectivity using curl.
You can use a simple CURL command can be used to test connectivity and the VT API key.
curl https://www.virustotal.com/vtapi/v2/file/report -F resource=1394942aef881f6fa872e0ce8c604bccb0ece22693b4fb5a5db0f5f2e6979f5e -F apikey=<vt-api-key>
The parameter "resource=" can be changed to the SHA256 hash of any file in the Virus Total database.
The parameter "apikey=" needs to be a valid Virus Total API key.
If connectivity is present and the API key is valid, a file report will be returned in JSON format.
If the API key is invalid, VT will return no text at all.
If connectivity is problematic, CURL will return an error such as "curl: (7)" for a connection failure.
CURL status codes may be found here: https://curl.haxx.se/libcurl/c/libcurl-errors.html