Merge pull request #7651 from Icinga/bugfix/icingadb-check_source

IcingaDB#SendStatusUpdate(): avoid CheckResult::Ptr(nullptr)->GetCheckSource()
This commit is contained in:
Noah Hilverling 2019-11-26 10:09:36 +01:00 committed by GitHub
commit 7f3fcaf31e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1192,13 +1192,17 @@ void IcingaDB::SendStatusUpdate(const ConfigObject::Ptr& object, const CheckResu
"previous_hard_state", Convert::ToString(GetPreviousState(checkable, service, StateTypeHard)),
"output", Utility::ValidateUTF8(std::move(output.first)),
"long_output", Utility::ValidateUTF8(std::move(output.second)),
"check_source", cr->GetCheckSource(),
"max_check_attempts", Convert::ToString(checkable->GetMaxCheckAttempts()),
"event_time", Convert::ToString(TimestampToMilliseconds(cr ? cr->GetExecutionEnd() : Utility::GetTime())),
"event_id", Utility::NewUniqueID(),
"event_type", "state_change"
});
if (cr) {
xAdd.emplace_back("check_source");
xAdd.emplace_back(cr->GetCheckSource());
}
if (service) {
xAdd.emplace_back("object_type");
xAdd.emplace_back("service");