Zabbix uses common functionality for external checks, user parameters, system.run items, custom alert scripts, remote commands and user scripts. Zabbix用常规功外部检查、用户参数、system.run监控项、自定义告警脚本、远程指令和用户指令。
The command/script is executed similarly on both Unix and Windows platforms:在Unix和Windows系统平台上,指令/脚本的执行方式相近
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. Zabbix假定命令/脚本在初始子进程退出时已完成处理,并且没有其他进程仍保持输出处理/文件描述符处于打开状态。 处理完成后,将终止所有创建的进程
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.仅适用于在Zabbix server and Zabbix proxy上执行的自定义告警脚本,远程命令和用户脚本。
*Any exit code that is different from 0 is considered as execution failure.任何不同于0的退出代码都被视为执行失败。
*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]]. 为Zabbix server上的远程命令创建附加日志条目以保存脚本执行输出,并可使用LogRemoteCommands agent [[:manual/appendix/config/zabbix_agentd|parameter]] 启用。
Possible frontend messages and log entries for failed commands/scripts: 可能出现的失败指令/脚本的前端信息和日志条目:
Read more about了解更多: