From: Alexander A. Klimov Date: Tue, 4 Dec 2018 16:44:42 +0000 (+0100) Subject: Add and populate Downtime#authoritative_zone X-Git-Tag: v2.11.0-rc1~267^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5431eae116df92d0b856e7f856da24df5a948144;p=icinga2 Add and populate Downtime#authoritative_zone refs #6542 --- 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; }; }