From 5431eae116df92d0b856e7f856da24df5a948144 Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Tue, 4 Dec 2018 17:44:42 +0100 Subject: [PATCH] Add and populate Downtime#authoritative_zone refs #6542 --- lib/icinga/downtime.cpp | 4 ++++ lib/icinga/downtime.ti | 1 + 2 files changed, 5 insertions(+) diff --git a/lib/icinga/downtime.cpp b/lib/icinga/downtime.cpp index 336329bc2..47ef789cb 100644 --- a/lib/icinga/downtime.cpp +++ b/lib/icinga/downtime.cpp @@ -247,6 +247,10 @@ String Downtime::AddDowntime(const Checkable::Ptr& checkable, const String& auth attrs->Set("config_owner", scheduledDowntime); attrs->Set("entry_time", Utility::GetTime()); + if (!scheduledDowntime.IsEmpty()) { + attrs->Set("authoritative_zone", Zone::GetLocalZone()->GetName()); + } + Host::Ptr host; Service::Ptr service; tie(host, service) = GetHostService(checkable); diff --git a/lib/icinga/downtime.ti b/lib/icinga/downtime.ti index 17c8cfe91..fe80e0e77 100644 --- a/lib/icinga/downtime.ti +++ b/lib/icinga/downtime.ti @@ -84,6 +84,7 @@ class Downtime : ConfigObject < DowntimeNameComposer [state] int legacy_id; [state] bool was_cancelled; [config] String config_owner; + [config] String authoritative_zone; }; }