From 70b4558a62234aefa30d9fccdd98b08a6c28f52f Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Mon, 9 Aug 2021 20:07:38 +0200 Subject: [PATCH] Icinga DB: introduce icinga:history:stream:downtime#scheduled_by ... with the Downtime#scheduled_by attribute. --- lib/icingadb/icingadb-objects.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/icingadb/icingadb-objects.cpp b/lib/icingadb/icingadb-objects.cpp index 69c1f2b57..1f6f85a37 100644 --- a/lib/icingadb/icingadb-objects.cpp +++ b/lib/icingadb/icingadb-objects.cpp @@ -1761,6 +1761,13 @@ void IcingaDB::SendStartedDowntime(const Downtime::Ptr& downtime) xAdd.emplace_back(GetObjectIdentifier(parent)); } + auto scheduledBy (downtime->GetScheduledBy()); + + if (!scheduledBy.IsEmpty()) { + xAdd.emplace_back("scheduled_by"); + xAdd.emplace_back(scheduledBy); + } + m_Rcon->FireAndForgetQuery(std::move(xAdd), Prio::History); } @@ -1841,6 +1848,13 @@ void IcingaDB::SendRemovedDowntime(const Downtime::Ptr& downtime) xAdd.emplace_back(GetObjectIdentifier(parent)); } + auto scheduledBy (downtime->GetScheduledBy()); + + if (!scheduledBy.IsEmpty()) { + xAdd.emplace_back("scheduled_by"); + xAdd.emplace_back(scheduledBy); + } + m_Rcon->FireAndForgetQuery(std::move(xAdd), Prio::History); }