]> granicus.if.org Git - icinga2/commitdiff
Add and populate Downtime#authoritative_zone
authorAlexander A. Klimov <alexander.klimov@icinga.com>
Tue, 4 Dec 2018 16:44:42 +0000 (17:44 +0100)
committerAlexander A. Klimov <alexander.klimov@icinga.com>
Mon, 17 Dec 2018 14:54:23 +0000 (15:54 +0100)
refs #6542

lib/icinga/downtime.cpp
lib/icinga/downtime.ti

index 336329bc2a0e0584e5e3e048498359f186702098..47ef789cba653c002d01d29fbd9c974421be2585 100644 (file)
@@ -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);
index 17c8cfe9156742740d3d49b1c3771e9c00f2e66a..fe80e0e77453586c4584cd12f9738348bdb5e93d 100644 (file)
@@ -84,6 +84,7 @@ class Downtime : ConfigObject < DowntimeNameComposer
        [state] int legacy_id;
        [state] bool was_cancelled;
        [config] String config_owner;
+       [config] String authoritative_zone;
 };
 
 }