Zabbix uses common functionality for external checks, user parameters, system.run items, custom alert scripts, remote commands and user scripts.
The command/script is executed similarly on both Unix and Windows platforms:
Zabbix assumes that a command/script has done processing when the initial child process has exited AND no other process is still keeping the output handle/file descriptor open. When processing is done, ALL created processes are terminated.
All double quotes and backslashes in the command are escaped with backslashes and the command is enclosed in double quotes.
Exit code are checked with the following conditions:
*Only for custom alert scripts, remote commands and user scripts executed on Zabbix server and Zabbix proxy. *Any exit code that is different from 0 is considered as execution failure. *Contents of standard error and standard output for failed executions are collected and available in frontend (where execution result is displayed). *Additional log entry is created for remote commands on Zabbix server to save script execution output and can be enabled using LogRemoteCommands agent [[:manual/appendix/config/zabbix_agentd|parameter]].
Possible frontend messages and log entries for failed commands/scripts:
Read more about: