> Action object
The following objects are directly related to the action API.
Action
The action object has the following properties.
| Property | Type | Description |
|---|---|---|
| actionid | string | (readonly) ID of the action. |
| esc_period (required) |
integer | Default operation step duration. Must be greater than 60 seconds. |
| evaltype (required) |
integer | Action condition evaluation method.
Possible values: |
| eventsource (required) |
integer | (constant) Type of events that the action will handle.
Refer to the event "source" property for a list of supported event types. |
| name (required) |
string | Name of the action. |
| def_longdata | string | Problem message text. |
| def_shortdata | string | Problem message subject. |
| r_longdata | string | Recovery message text. |
| r_shortdata | string | Recovery message subject. |
| recovery_msg | integer | Whether recovery messages are enabled.
Possible values: |
| status | integer | Whether the action is enabled or disabled.
Possible values: |
Action condition
The action condition object defines a condition that must be met to perform the configured action operations. It has the following properties.
| Property | Type | Description |
|---|---|---|
| conditionid | string | (readonly) ID of the action condition. |
| conditiontype (required) |
integer | Type of condition.
Possible values for trigger actions: Possible values for discovery actions: Possible values for auto-registration actions: Possible values for internal actions: |
| value (required) |
string | Value to compare with. |
| actionid | string | (readonly) ID of the action that the condition belongs to. |
| operator | integer | Condition operator.
Possible values: |
The following operators and values are supported for each condition type.
| Condition | Condition name | Supported operators | Expected value |
|---|---|---|---|
| 0 | Host group | =, <> | Host group ID. |
| 1 | Host | =, <> | Host ID. |
| 2 | Trigger | =, <> | Trigger ID. |
| 3 | Trigger name | like, not like | Trigger name. |
| 4 | Trigger severity | =, <>, >=, <= | Trigger severity. Refer to the trigger "severity" property for a list of supported trigger severities. |
| 5 | Trigger value | = | Trigger value. Refer to the trigger "value" property for a list of supported trigger values. |
| 6 | Time period | in, not in | Time when the event was triggered as a time period. |
| 7 | Host IP | =, <> | One or several IP ranges to check separated by commas. Refer to the network discovery configuration section for more information on supported formats of IP ranges. |
| 8 | Discovered service type | =, <> | Type of discovered service. The type of service matches the type of the discovery check used to detect the service. Refer to the discovery check "type" property for a list of supported types. |
| 9 | Discovered service port | =, <> | One or several port ranges separated by commas. |
| 10 | Discovery status | = | Status of a discovered object.
Possible values: |
| 11 | Uptime or downtime duration | >=, <= | Time indicating how long has the discovered object been in the current status in seconds. |
| 12 | Received values | =, <>, >=, <=, like, not like | Value returned when performing a Zabbix agent, SNMPv1, SNMPv2 or SNMPv3 discovery check. |
| 13 | Host template | =, <> | Linked template ID. |
| 15 | Application | =, like, not like | Name of the application. |
| 16 | Maintenance status | in, not in | No value required: using the “in” operator means that the host must be in maintenance, “not in” – not in maintenance. |
| 17 | Node | =, <> | ID of the distributed monitoring node. |
| 18 | Discovery rule | =, <> | ID of the discovery rule. |
| 19 | Discovery check | =, <> | ID of the discovery check. |
| 20 | Proxy | =, <> | ID of the proxy. |
| 21 | Discovery object | = | Type of object that triggered the discovery event.
Possible values: |
| 22 | Host name | like, not like | Host name. |
| 23 | Event type | = | Specific internal event.
Possible values: |
| 24 | Host metadata | like, not like | Metadata of the auto-registered host. |
Action operation
The action operation object defines an operation that will be performed when an action is executed. It has the following properties.
| Property | Type | Description |
|---|---|---|
| operationid | string | (readonly) ID of the action operation. |
| operationtype (required) |
integer | Type of operation.
Possible values: |
| actionid | string | ID of the action that the operation belongs to. |
| esc_period | integer | Duration of an escalation step in seconds. Must be greater than 60 seconds. If set to 0, the default action escalation period will be used.
Default: 0. |
| esc_step_from | integer | Step to start escalation from.
Default: 1. |
| esc_step_to | integer | Step to end escalation at.
Default: 1. |
| evaltype | integer | Operation condition evaluation method.
Possible values: |
| opcommand | object | Object containing the data about the command run by the operation.
The operation command object is described in detail below. Required for remote command operations. |
| opcommand_grp | array | Host groups to run remote commands on.
Each object has the following properties: Required for remote command operations if |
| opcommand_hst | array | Host to run remote commands on.
Each object has the following properties: Required for remote command operations if |
| opconditions | array | Operation conditions used for trigger actions.
The operation condition object is described in detail below. |
| opgroup | array | Host groups to add hosts to.
Each object has the following properties: Required for “add to host group” and “remove from host group” operations. |
| opmessage | object | Object containing the data about the message sent by the operation.
The operation message object is described in detail below. Required for message operations. |
| opmessage_grp | array | User groups to send messages to.
Each object has the following properties: Required for message operations if |
| opmessage_usr | array | Users to send messages to.
Each object has the following properties: Required for message operations if |
| optemplate | array | Templates to link the hosts to to.
Each object has the following properties: Required for “link to template” and “unlink from template” operations. |
Action operation command
The operation command object contains data about the command that will be run by the operation.
| Property | Type | Description |
|---|---|---|
| operationid | string | (readonly) ID of the operation. |
| command (required) |
string | Command to run. |
| type (required) |
integer | Type of operation command.
Possible values: |
| authtype | integer | Authentication method used for SSH commands.
Possible values: Required for SSH commands. |
| execute_on | integer | Target on which the custom script operation command will be executed.
Possible values: Required for custom script commands. |
| password | string | Password used for SSH commands with password authentication and Telnet commands. |
| port | string | Port number used for SSH and Telnet commands. |
| privatekey | string | Name of the private key file used for SSH commands with public key authentication.
Required for SSH commands with public key authentication. |
| publickey | string | Name of the public key file used for SSH commands with public key authentication.
Required for SSH commands with public key authentication. |
| scriptid | string | ID of the script used for global script commands.
Required for global script commands. |
| username | string | User name used for authentication.
Required for SSH and Telnet commands. |
Action operation message
The operation message object contains data about the message that will be sent by the operation.
| Property | Type | Description |
|---|---|---|
| operationid | string | (readonly) ID of the action operation. |
| default_msg | integer | Whether to use the default action message text and subject.
Possible values: |
| mediatypeid | string | ID of the media type that will be used to send the message. |
| message | string | Operation message text. |
| subject | string | Operation message subject. |
Action operation condition
The action operation condition object defines a condition that must be met to perform the current operation. It has the following properties.
| Property | Type | Description |
|---|---|---|
| opconditionid | string | (readonly) ID of the action operation condition |
| conditiontype (required) |
integer | Type of condition.
Possible values: |
| value (required) |
string | Value to compare with. |
| operationid | string | (readonly) ID of the operation. |
| operator | integer | Condition operator.
Possible values: |
The following operators and values are supported for each operation condition type.
| Condition | Condition name | Supported operators | Expected value |
|---|---|---|---|
| 14 | Event acknowledged | = | Whether the event is acknowledged.
Possible values: |
Data source: Zabbix