IcingaDB: correct icinga:history:stream:state#{,last_}soft_state and icinga:history:stream:notification#state for hosts

This commit is contained in:
Alexander A. Klimov 2019-11-04 16:40:04 +01:00
parent d81c15ca2f
commit 4e8584ee9e
1 changed files with 3 additions and 3 deletions

View File

@ -1179,11 +1179,11 @@ void IcingaDB::SendStatusUpdate(const ConfigObject::Ptr& object, const CheckResu
"id", Utility::NewUniqueID(),
"environment_id", SHA1(GetEnvironment()),
"state_type", Convert::ToString(type),
"soft_state", Convert::ToString(cr ? cr->GetState() : 99),
"soft_state", Convert::ToString(cr ? service ? cr->GetState() : Host::CalculateState(cr->GetState()) : 99),
"hard_state", Convert::ToString(service ? service->GetLastHardState() : host->GetLastHardState()),
"attempt", Convert::ToString(checkable->GetCheckAttempt()),
// TODO: last_hard/soft_state should be "previous".
"last_soft_state", Convert::ToString(cr ? cr->GetState() : 99),
"last_soft_state", Convert::ToString(cr ? service ? cr->GetState() : Host::CalculateState(cr->GetState()) : 99),
"last_hard_state", Convert::ToString(service ? service->GetLastHardState() : host->GetLastHardState()),
"previous_soft_state", Convert::ToString(GetPreviousState(checkable, service, StateTypeSoft)),
"previous_hard_state", Convert::ToString(GetPreviousState(checkable, service, StateTypeHard)),
@ -1239,7 +1239,7 @@ void IcingaDB::SendSentNotification(
"environment_id", SHA1(GetEnvironment()),
"notification_id", GetObjectIdentifier(notification),
"type", Convert::ToString(type),
"state", Convert::ToString(cr->GetState()),
"state", Convert::ToString(service ? cr->GetState() : Host::CalculateState(cr->GetState())),
"previous_hard_state", Convert::ToString(GetPreviousState(checkable, service, StateTypeHard)),
"author", Utility::ValidateUTF8(author),
"text", Utility::ValidateUTF8(finalText),