Fix notification history not setting text if notification is triggered by checkresult

This commit is contained in:
Noah Hilverling 2019-10-31 13:32:06 +01:00 committed by Michael Friedrich
parent 4a43dd1ce6
commit 0aa885573d
1 changed files with 6 additions and 1 deletions

View File

@ -1238,6 +1238,11 @@ void IcingaDB::SendSentNotification(
auto service (dynamic_pointer_cast<Service>(checkable));
auto finalText = text;
if (finalText == "" && cr) {
finalText = cr->GetOutput();
}
std::vector<String> xAdd ({
"XADD", "icinga:history:stream:notification", "*",
"id", Utility::NewUniqueID(),
@ -1247,7 +1252,7 @@ void IcingaDB::SendSentNotification(
"state", Convert::ToString(cr->GetState()),
"previous_hard_state", Convert::ToString(GetPreviousHardState(checkable, service)),
"author", Utility::ValidateUTF8(author),
"text", Utility::ValidateUTF8(text),
"text", Utility::ValidateUTF8(finalText),
"users_notified", Convert::ToString(users),
"event_time", Convert::ToString(TimestampToMilliseconds(Utility::GetTime())),
"event_id", Utility::NewUniqueID(),