Sidebar

manual:api:reference:script:object

> Script object

The following objects are directly related to the script API.

Script

The script object has the following properties.

Property Type Description
scriptid string (readonly) ID of the script.
command
(required)
string Command to run.
name
(required)
string Name of the script.
confirmation string Confirmation pop up text. The pop up will appear when trying to run the script from the Zabbix frontend.
description string Description of the script.
execute_on integer Where to run the script.

Possible values:
0 - run on Zabbix agent;
1 - run on Zabbix server.
2 - (default) run on Zabbix server (proxy).
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.
host_access integer Host permissions needed to run the script.

Possible values:
2 - (default) read;
3 - write.
type
(required)
integer Script type.

Possible values:
0 - Script;
1 - IPMI;
5 - (default) Webhook.
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.

Default: 0.
timeout string Webhook script execution timeout in seconds. Time suffixes are supported, e.g. 30s, 1m.

Possible values:
1-60s

Default value:
30s
parameters array Array of webhook input parameters.

Webhook parameters

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

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.

Log entry

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.