diff --git a/lib/icinga/downtime.cpp b/lib/icinga/downtime.cpp index 4180747ac..d9b24a3d3 100644 --- a/lib/icinga/downtime.cpp +++ b/lib/icinga/downtime.cpp @@ -215,7 +215,7 @@ bool Downtime::HasValidConfigOwner() const } String configOwner = GetConfigOwner(); - return configOwner.IsEmpty() || GetObject(configOwner); + return configOwner.IsEmpty() || Zone::GetByName(GetAuthoritativeZone()) != Zone::GetLocalZone() || GetObject(configOwner); } int Downtime::GetNextDowntimeID() @@ -251,6 +251,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; }; }