event.acknowledge

説明

object event.acknowledge(object/array parameters)

This method allows to update events. The following update actions can be performed:

このメソッドでは、以下のイベントの操作が可能です:

  • イベントのクローズ。イベントが既に解決されている場合、このアクションはスキップされます。
  • イベントの確認化。イベントが既に確認されている場合、このアクションはスキップされます。
  • イベントの未確認化. イベントが未確認の場合、このアクションはスキップされます。
  • メッセージ追加
  • イベントの深刻度. イベントの深刻度が同じ場合は、このアクションはスキップされます。
  • イベントの抑制化. イベントが既に抑制されている場合、このアクションはスキップされます。
  • イベントの未抑制化. イベントが抑制されていない場合、このアクションはスキップされます。

トリガーイベントのみ更新可能です。
問題イベントのみ更新可能です。
イベントクローズ、またはイベントの深刻度を変更するには、トリガーに対する読み取り/書き込み権限が必要です。
イベントクローズする為には、トリガーで手動クローズを許可する必要があります。

このメソッドは、あらゆるタイプのユーザーが利用できます。メソッドを呼び出す権限は、ユーザーロール設定で取り消すことができます。詳しくは、ユーザーロール をご覧ください。

パラメータ

(object/array) 実行すべきイベントと更新操作の ID を含むパラメータ

パラメータ タイプ 説明
eventids ID/array IDs of the events to acknowledge.

Parameter behavior:
- required
action integer Event update action(s).

Possible bitmap values:
1 - close problem;
2 - acknowledge event;
4 - add message;
8 - change severity;
16 - unacknowledge event;
32 - suppress event;
64 - unsuppress event;
128 - change event rank to cause;
256 - change event rank to symptom.

This is a bitmask field; any sum of possible bitmap values is acceptable (for example, 34 for acknowledge and suppress event).

Parameter behavior:
- required
cause_eventid ID Cause event ID.

Parameter behavior:
- required if action contains the "change event rank to symptom" bit
message string Text of the message.

Parameter behavior:
- required if action contains the "add message" bit
severity integer New severity for events.

Possible values:
0 - not classified;
1 - information;
2 - warning;
3 - average;
4 - high;
5 - disaster.

Parameter behavior:
- required if action contains the "change severity" bit
suppress_until integer Unix timestamp until which event must be suppressed.

If set to "0", the suppression will be indefinite.

Parameter behavior:
- required if action contains the "suppress event" bit

戻り値

(object) eventids プロパティの下で更新されたイベントの ID を含むオブジェクトを返します。

イベントの確認

1つのイベントを確認し、メッセージを残します。

リクエスト:

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

レスポンス:

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

イベントの深刻度の変更

複数のイベントの深刻度を変更し、メッセージを残します。

リクエスト:

{
           "jsonrpc": "2.0",
           "method": "event.acknowledge",
           "params": {
               "eventids": ["20427", "20428"],
               "action": 12,
               "message": "Maintenance required to fix it.",
               "severity": 4
           },
           "id": 1
       }

レスポンス:

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

ソース

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