event.acknowledge

Description

object event.acknowledge(object/array parameters)

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

  • Close event. If event is already resolved, this action will be skipped.
  • Acknowledge event. If event is already acknowledged, this action will be skipped.
  • Unacknowledge event. If event is not acknowledged, this action will be skipped.
  • Add message.
  • Change event severity. If event already has same severity, this action will be skipped.
  • Suppress event. If event is already suppressed, this action will be skipped.
  • Unsuppress event. If event is not suppressed, this action will be skipped.

Only trigger events can be updated.
Only problem events can be updated.
Read/Write rights for trigger are required to close the event or to change event’s severity.
To close an event, manual close should be allowed in the trigger.

This method is available to users of any type. Permissions to call the method can be revoked in user role settings. See User roles for more information.

Parameters

(object/array) Parameters containing the IDs of the events and update operations that should be performed.

ParameterTypeDescription
eventidsstring/objectIDs of the events to acknowledge.

Parameter behavior:
- required
actionintegerEvent update action(s).
This is a bitmask field, any combination of possible bitmap values is acceptable.

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.

Parameter behavior:
- required
cause_eventidstringCause event ID.

Parameter behavior:
- required if action contains the “change event rank to symptom” bit
messagestringText of the message.

Parameter behavior:
- required if action contains the “add message” bit
severityintegerNew 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_untilintegerUnix 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

Return values

(object) Returns an object containing the IDs of the updated events under the eventids property.

Examples

Acknowledging an event

Acknowledge a single event and leave a message.

Request:

  1. {
  2. "jsonrpc": "2.0",
  3. "method": "event.acknowledge",
  4. "params": {
  5. "eventids": "20427",
  6. "action": 6,
  7. "message": "Problem resolved."
  8. },
  9. "id": 1
  10. }

Response:

  1. {
  2. "jsonrpc": "2.0",
  3. "result": {
  4. "eventids": [
  5. "20427"
  6. ]
  7. },
  8. "id": 1
  9. }

Changing event’s severity

Change severity for multiple events and leave a message.

Request:

  1. {
  2. "jsonrpc": "2.0",
  3. "method": "event.acknowledge",
  4. "params": {
  5. "eventids": ["20427", "20428"],
  6. "action": 12,
  7. "message": "Maintenance required to fix it.",
  8. "severity": 4
  9. },
  10. "id": 1
  11. }

Response:

  1. {
  2. "jsonrpc": "2.0",
  3. "result": {
  4. "eventids": [
  5. "20427",
  6. "20428"
  7. ]
  8. },
  9. "id": 1
  10. }

Source

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