mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-25 22:54:57 +02:00
#7735 API-Event StateChange & CheckResult: Added acknowledgement and downtime_depth
This commit is contained in:
parent
387c2c8b79
commit
ca487ed732
@ -1585,25 +1585,29 @@ Example for all downtime events:
|
|||||||
|
|
||||||
#### <a id="icinga2-api-event-streams-type-checkresult"></a> Event Stream Type: CheckResult
|
#### <a id="icinga2-api-event-streams-type-checkresult"></a> Event Stream Type: CheckResult
|
||||||
|
|
||||||
Name | Type | Description
|
Name | Type | Description
|
||||||
--------------|---------------|--------------------------
|
-----------------|---------------|--------------------------
|
||||||
type | String | Event type `CheckResult`.
|
type | String | Event type `CheckResult`.
|
||||||
timestamp | Timestamp | Unix timestamp when the event happened.
|
timestamp | Timestamp | Unix timestamp when the event happened.
|
||||||
host | String | [Host](09-object-types.md#objecttype-host) name.
|
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.
|
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.
|
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
|
#### <a id="icinga2-api-event-streams-type-statechange"></a> Event Stream Type: StateChange
|
||||||
|
|
||||||
Name | Type | Description
|
Name | Type | Description
|
||||||
--------------|---------------|--------------------------
|
-----------------|---------------|--------------------------
|
||||||
type | String | Event type `StateChange`.
|
type | String | Event type `StateChange`.
|
||||||
timestamp | Timestamp | Unix timestamp when the event happened.
|
timestamp | Timestamp | Unix timestamp when the event happened.
|
||||||
host | String | [Host](09-object-types.md#objecttype-host) name.
|
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.
|
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 | 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.
|
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.
|
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
|
#### <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("check_result", Serialize(cr));
|
||||||
|
|
||||||
|
result->Set("downtime_depth", checkable->GetDowntimeDepth());
|
||||||
|
result->Set("acknowledgement", checkable->IsAcknowledged());
|
||||||
|
|
||||||
for (const EventQueue::Ptr& queue : queues) {
|
for (const EventQueue::Ptr& queue : queues) {
|
||||||
queue->ProcessEvent(result);
|
queue->ProcessEvent(result);
|
||||||
}
|
}
|
||||||
@ -89,6 +92,9 @@ void ApiEvents::StateChangeHandler(const Checkable::Ptr& checkable, const CheckR
|
|||||||
result->Set("state_type", checkable->GetStateType());
|
result->Set("state_type", checkable->GetStateType());
|
||||||
result->Set("check_result", Serialize(cr));
|
result->Set("check_result", Serialize(cr));
|
||||||
|
|
||||||
|
result->Set("downtime_depth", checkable->GetDowntimeDepth());
|
||||||
|
result->Set("acknowledgement", checkable->IsAcknowledged());
|
||||||
|
|
||||||
for (const EventQueue::Ptr& queue : queues) {
|
for (const EventQueue::Ptr& queue : queues) {
|
||||||
queue->ProcessEvent(result);
|
queue->ProcessEvent(result);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user