> Alert object

以下是 alert API 的使用方法

告警

Alerts 是由 Zabbix server 创建,无法通过 API 修改。

alert 对象包含有关某些 action 操作是否已成功执行的信息,它具有以下特性。

特性类型描述
alertidstringAlert ID 值。
actionidstringAlert 生成的 Action ID.
alerttypeintegerAlert 类型。

可能的值:
0 - 信息;
1 - 远程命令。
clocktimestampAlert 生成的时间。
errorstringAlert 发送信息或者执行一个命令产生的报错信息。
esc_stepinteger生成 Alert 后 Action 的处理步骤。
eventidstring触发 Action 的事件 ID。
mediatypeidstring用于发送消息的报警媒介类型的 ID。
messagetext消息文本。用于消息告警。
retriesintegerZabbix 尝试发送消息的次数。
sendtostring地址,用户名或接收者的其他标识符。用于消息告警。
statusinteger显示 action 操作是否已执行成功的状态。

消息告警的可能值:
0 - 消息未发送。
1 - 消息已发送。
2 - 经多次重试后失败。
3 - action 管理器尚未处理新警报。

命令告警的可能值:
0 - 命令没有运行。
1 - 命令运行成功。
2 - 尝试在 Zabbix agent 上运行命令但不可用。
subjectstring消息主题。用于消息告警。
useridstring邮件发送到的用户的 ID。
p_eventidstring生成告警的异常事件 ID。
acknowledgeidstring生成告警的确认 ID。

The following objects are directly related to the alert API.

Alert

Alerts are created by the Zabbix server and cannot be modified via the API.

The alert object contains information about whether certain action operations have been executed successfully. It has the following properties.

PropertyTypeDescription
alertidstringID of the alert.
actionidstringID of the action that generated the alert.
alerttypeintegerAlert type.

Possible values:
0 - message;
1 - remote command.
clocktimestampTime when the alert was generated.
errorstringError text if there are problems sending a message or running a command.
esc_stepintegerAction escalation step during which the alert was generated.
eventidstringID of the event that triggered the action.
mediatypeidstringID of the media type that was used to send the message.
messagetextMessage text. Used for message alerts.
retriesintegerNumber of times Zabbix tried to send the message.
sendtostringAddress, user name or other identifier of the recipient. Used for message alerts.
statusintegerStatus indicating whether the action operation has been executed successfully.

Possible values for message alerts:
0 - message not sent.
1 - message sent.
2 - failed after a number of retries.
3 - new alert is not yet processed by alert manager.

Possible values for command alerts:
0 - command not run.
1 - command run.
2 - tried to run the command on the Zabbix agent but it was unavailable.
subjectstringMessage subject. Used for message alerts.
useridstringID of the user that the message was sent to.
p_eventidstringID of problem event, which generated the alert.
acknowledgeidstringID of acknowledgement, which generated the alert.