The following objects are directly related to the script API.
The script object has the following properties.
| Property | Type | Description |
|---|---|---|
| scriptid | string | (readonly) ID of the script. |
| name (required) |
string | Name of the script. |
| type (required) |
integer | Script type. Possible values: 0 - Script; 1 - IPMI; 2 - SSH; 3 - Telnet; 5 - (default) Webhook. |
| command (required) |
string | Command to run. |
| scope | integer | Script scope. Possible values: 1 - default action operation; 2 - manual host action; 4 - manual event action. |
| execute_on | integer | Where to run the script. Used if type is 0 (script).Possible values: 0 - run on Zabbix agent; 1 - run on Zabbix server; 2 - (default) run on Zabbix server (proxy). |
| menu_path | string | Folders separated by slash that form a menu like navigation in frontend when clicked on host or event. Used if scope is 2 or 4. |
| authtype | integer | Authentication method used for SSH script type. Used if type is 2.Possible values: 0 - password; 1 - public key. |
| username | string | User name used for authentication. Required if type is 2 or 3. |
| password | string | Password used for SSH scripts with password authentication and Telnet scripts. Used if type is 2 and authtype is 0 or type is 3. |
| publickey | string | Name of the public key file used for SSH scripts with public key authentication. Required if type is 2 and authtype is 1. |
| privatekey | string | Name of the private key file used for SSH scripts with public key authentication. Required if type is 2 and authtype is 1. |
| port | string | Port number used for SSH and Telnet scripts. Used if type is 2 or 3. |
| groupid | string | ID of the host group that the script can be run on. If set to 0, the script will be available on all host groups. Default: 0. |
| usrgrpid | string | ID of the user group that will be allowed to run the script. If set to 0, the script will be available for all user groups. Used if scope is 2 or 4.Default: 0. |
| host_access | integer | Host permissions needed to run the script. Used if scope is 2 or 4.Possible values: 2 - (default) read; 3 - write. |
| confirmation | string | Confirmation pop up text. The pop up will appear when trying to run the script from the Zabbix frontend. Used if scope is 2 or 4. |
| timeout | string | Webhook script execution timeout in seconds. Time suffixes are supported, e.g. 30s, 1m. Required if type is 5.Possible values: 1-60s Default value: 30s |
| parameters | array | Array of webhook input parameters. Used if type is 5. |
| description | string | Description of the script. |
Parameters passed to webhook script when it is called have the following properties.
| Property | Type | Description |
|---|---|---|
| name (required) |
string | Parameter name. |
| value | string | Parameter value. Supports macros. |
Debug information of executed webhook script. The debug object has the following properties.
| Property | Type | Description |
|---|---|---|
| logs | array | Array of log entries. |
| ms | string | Script execution duration in milliseconds. |
The log entry object has the following properties.
| Property | Type | Description |
|---|---|---|
| level | integer | Log level. |
| ms | string | The time elapsed in milliseconds since the script was run before log entry was added. |
| message | string | Log message. |