Sidebar

Zabbix Summit 2022
Register for Zabbix Summit 2022

event.acknowledge

Description 说明

object event.acknowledge(object/array parameters)

This method allows to acknowledge events and add an acknowledgement message. If an event is already acknowledged, a new message will still be added.该方法允许确认事件并添加确认消息。如果事件已被确认,仍可添加一条新消息。

Only trigger events can be acknowledged.只有触发事件可以被确认。

Parameters参数

(object/array) Parameters containing the IDs of the events acknowledge and a message.包含事件确认的ID的参数和消息。

参数 类 说明
eventids
(required)
string/object IDs of the events to acknowledge. 要确认的事件的ID。
message string Text of the acknowledgement message.确认消息的文本。
action integer Action on event acknowledgement.对事件确认的动作

Possible values: 可能的值:
0 - (default) none; (默认)//无;
1 - close problem. 关闭问题

Return values返回值

(object) Returns an object containing the IDs of the acknowledged events under the eventids property. 返回一个包含“eventid”属性下的已确认事件ID的对象。

Examples示例

Acknowledging an event 确认一个事件

Acknowledge a single event and leave a message.确认一个事件并留言。

Request:

{
           "jsonrpc": "2.0",
           "method": "event.acknowledge",
           "params": {
               "eventids": "20427",
               "message": "Problem resolved.",
               "action": 1
           },
           "auth": "038e1d7b1735c6a5436ee9eae095879e",
           "id": 1
       }

Response:

{
           "jsonrpc": "2.0",
           "result": {
               "eventids": [
                   "20427"
               ]
           },
           "id": 1
       }

Source来源

CEvent::acknowledge() in frontends/php/include/classes/api/services/CEvent.php.