mirror of https://github.com/Icinga/icinga2.git
IcingaDB#SendStatusUpdate(): avoid CheckResult::Ptr(nullptr)->GetCheckSource()
This commit is contained in:
parent
287e4c3a8d
commit
407d6c0219
|
@ -1192,13 +1192,17 @@ void IcingaDB::SendStatusUpdate(const ConfigObject::Ptr& object, const CheckResu
|
||||||
"previous_hard_state", Convert::ToString(GetPreviousState(checkable, service, StateTypeHard)),
|
"previous_hard_state", Convert::ToString(GetPreviousState(checkable, service, StateTypeHard)),
|
||||||
"output", Utility::ValidateUTF8(std::move(output.first)),
|
"output", Utility::ValidateUTF8(std::move(output.first)),
|
||||||
"long_output", Utility::ValidateUTF8(std::move(output.second)),
|
"long_output", Utility::ValidateUTF8(std::move(output.second)),
|
||||||
"check_source", cr->GetCheckSource(),
|
|
||||||
"max_check_attempts", Convert::ToString(checkable->GetMaxCheckAttempts()),
|
"max_check_attempts", Convert::ToString(checkable->GetMaxCheckAttempts()),
|
||||||
"event_time", Convert::ToString(TimestampToMilliseconds(cr ? cr->GetExecutionEnd() : Utility::GetTime())),
|
"event_time", Convert::ToString(TimestampToMilliseconds(cr ? cr->GetExecutionEnd() : Utility::GetTime())),
|
||||||
"event_id", Utility::NewUniqueID(),
|
"event_id", Utility::NewUniqueID(),
|
||||||
"event_type", "state_change"
|
"event_type", "state_change"
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (cr) {
|
||||||
|
xAdd.emplace_back("check_source");
|
||||||
|
xAdd.emplace_back(cr->GetCheckSource());
|
||||||
|
}
|
||||||
|
|
||||||
if (service) {
|
if (service) {
|
||||||
xAdd.emplace_back("object_type");
|
xAdd.emplace_back("object_type");
|
||||||
xAdd.emplace_back("service");
|
xAdd.emplace_back("service");
|
||||||
|
|
Loading…
Reference in New Issue