mirror of https://github.com/Icinga/icinga2.git
Merge pull request #7736 from froehl/7735
API-Event StateChange & CheckResult: Added acknowledgement and downtime_depth…
This commit is contained in:
commit
3fa1eab344
|
@ -1585,25 +1585,29 @@ Example for all downtime events:
|
|||
|
||||
#### <a id="icinga2-api-event-streams-type-checkresult"></a> Event Stream Type: CheckResult
|
||||
|
||||
Name | Type | Description
|
||||
--------------|---------------|--------------------------
|
||||
type | String | Event type `CheckResult`.
|
||||
timestamp | Timestamp | Unix timestamp when the event happened.
|
||||
host | String | [Host](09-object-types.md#objecttype-host) name.
|
||||
service | String | [Service](09-object-types.md#objecttype-service) name. Optional if this is a host check result.
|
||||
check\_result | CheckResult | Serialized [CheckResult](08-advanced-topics.md#advanced-value-types-checkresult) value type.
|
||||
Name | Type | Description
|
||||
-----------------|---------------|--------------------------
|
||||
type | String | Event type `CheckResult`.
|
||||
timestamp | Timestamp | Unix timestamp when the event happened.
|
||||
host | String | [Host](09-object-types.md#objecttype-host) name.
|
||||
service | String | [Service](09-object-types.md#objecttype-service) name. Optional if this is a host check result.
|
||||
check\_result | CheckResult | Serialized [CheckResult](08-advanced-topics.md#advanced-value-types-checkresult) value type.
|
||||
downtime\_depth | Number | Amount of active downtimes on the checkable.
|
||||
acknowledgement | Boolean | Whether the object is acknowledged.
|
||||
|
||||
#### <a id="icinga2-api-event-streams-type-statechange"></a> Event Stream Type: StateChange
|
||||
|
||||
Name | Type | Description
|
||||
--------------|---------------|--------------------------
|
||||
type | String | Event type `StateChange`.
|
||||
timestamp | Timestamp | Unix timestamp when the event happened.
|
||||
host | String | [Host](09-object-types.md#objecttype-host) name.
|
||||
service | String | [Service](09-object-types.md#objecttype-service) name. Optional if this is a host state change.
|
||||
state | Number | [Host](09-object-types.md#objecttype-host) or [service](09-object-types.md#objecttype-service) state.
|
||||
state\_type | Number | [Host](09-object-types.md#objecttype-host) or [service](09-object-types.md#objecttype-service) state type.
|
||||
check\_result | CheckResult | Serialized [CheckResult](08-advanced-topics.md#advanced-value-types-checkresult) value type.
|
||||
Name | Type | Description
|
||||
-----------------|---------------|--------------------------
|
||||
type | String | Event type `StateChange`.
|
||||
timestamp | Timestamp | Unix timestamp when the event happened.
|
||||
host | String | [Host](09-object-types.md#objecttype-host) name.
|
||||
service | String | [Service](09-object-types.md#objecttype-service) name. Optional if this is a host state change.
|
||||
state | Number | [Host](09-object-types.md#objecttype-host) or [service](09-object-types.md#objecttype-service) state.
|
||||
state\_type | Number | [Host](09-object-types.md#objecttype-host) or [service](09-object-types.md#objecttype-service) state type.
|
||||
check\_result | CheckResult | Serialized [CheckResult](08-advanced-topics.md#advanced-value-types-checkresult) value type.
|
||||
downtime\_depth | Number | Amount of active downtimes on the checkable.
|
||||
acknowledgement | Boolean | Whether the object is acknowledged.
|
||||
|
||||
#### <a id="icinga2-api-event-streams-type-notification"></a> Event Stream Type: Notification
|
||||
|
||||
|
|
|
@ -56,6 +56,9 @@ void ApiEvents::CheckResultHandler(const Checkable::Ptr& checkable, const CheckR
|
|||
|
||||
result->Set("check_result", Serialize(cr));
|
||||
|
||||
result->Set("downtime_depth", checkable->GetDowntimeDepth());
|
||||
result->Set("acknowledgement", checkable->IsAcknowledged());
|
||||
|
||||
for (const EventQueue::Ptr& queue : queues) {
|
||||
queue->ProcessEvent(result);
|
||||
}
|
||||
|
@ -89,6 +92,9 @@ void ApiEvents::StateChangeHandler(const Checkable::Ptr& checkable, const CheckR
|
|||
result->Set("state_type", checkable->GetStateType());
|
||||
result->Set("check_result", Serialize(cr));
|
||||
|
||||
result->Set("downtime_depth", checkable->GetDowntimeDepth());
|
||||
result->Set("acknowledgement", checkable->IsAcknowledged());
|
||||
|
||||
for (const EventQueue::Ptr& queue : queues) {
|
||||
queue->ProcessEvent(result);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue