mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-26 23:24:09 +02:00
Fix notification history not setting text if notification is triggered by checkresult
This commit is contained in:
parent
4a43dd1ce6
commit
0aa885573d
@ -1238,6 +1238,11 @@ void IcingaDB::SendSentNotification(
|
|||||||
|
|
||||||
auto service (dynamic_pointer_cast<Service>(checkable));
|
auto service (dynamic_pointer_cast<Service>(checkable));
|
||||||
|
|
||||||
|
auto finalText = text;
|
||||||
|
if (finalText == "" && cr) {
|
||||||
|
finalText = cr->GetOutput();
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<String> xAdd ({
|
std::vector<String> xAdd ({
|
||||||
"XADD", "icinga:history:stream:notification", "*",
|
"XADD", "icinga:history:stream:notification", "*",
|
||||||
"id", Utility::NewUniqueID(),
|
"id", Utility::NewUniqueID(),
|
||||||
@ -1247,7 +1252,7 @@ void IcingaDB::SendSentNotification(
|
|||||||
"state", Convert::ToString(cr->GetState()),
|
"state", Convert::ToString(cr->GetState()),
|
||||||
"previous_hard_state", Convert::ToString(GetPreviousHardState(checkable, service)),
|
"previous_hard_state", Convert::ToString(GetPreviousHardState(checkable, service)),
|
||||||
"author", Utility::ValidateUTF8(author),
|
"author", Utility::ValidateUTF8(author),
|
||||||
"text", Utility::ValidateUTF8(text),
|
"text", Utility::ValidateUTF8(finalText),
|
||||||
"users_notified", Convert::ToString(users),
|
"users_notified", Convert::ToString(users),
|
||||||
"event_time", Convert::ToString(TimestampToMilliseconds(Utility::GetTime())),
|
"event_time", Convert::ToString(TimestampToMilliseconds(Utility::GetTime())),
|
||||||
"event_id", Utility::NewUniqueID(),
|
"event_id", Utility::NewUniqueID(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user