From: Michael Friedrich Date: Tue, 29 Mar 2016 10:09:51 +0000 (+0200) Subject: Fix: Downtimes/Comments not being synced to child zones X-Git-Tag: v2.5.0~443 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=12dadfdfb311b3fa3952b1858b1d3d1a98ff95f4;p=icinga2 Fix: Downtimes/Comments not being synced to child zones fixes #11227 --- diff --git a/lib/icinga/comment.cpp b/lib/icinga/comment.cpp index bbdeb2eee..b411a4143 100644 --- a/lib/icinga/comment.cpp +++ b/lib/icinga/comment.cpp @@ -175,6 +175,11 @@ String Comment::AddComment(const Checkable::Ptr& checkable, CommentType entryTyp if (service) attrs->Set("service_name", service->GetShortName()); + String zone = checkable->GetZoneName(); + + if (!zone.IsEmpty()) + attrs->Set("zone", zone); + String config = ConfigObjectUtility::CreateObjectConfig(Comment::TypeInstance, fullName, true, Array::Ptr(), attrs); Array::Ptr errors = new Array(); diff --git a/lib/icinga/downtime.cpp b/lib/icinga/downtime.cpp index b7b17f0e4..d7668f795 100644 --- a/lib/icinga/downtime.cpp +++ b/lib/icinga/downtime.cpp @@ -223,6 +223,11 @@ String Downtime::AddDowntime(const Checkable::Ptr& checkable, const String& auth if (service) attrs->Set("service_name", service->GetShortName()); + String zone = checkable->GetZoneName(); + + if (!zone.IsEmpty()) + attrs->Set("zone", zone); + String config = ConfigObjectUtility::CreateObjectConfig(Downtime::TypeInstance, fullName, true, Array::Ptr(), attrs); Array::Ptr errors = new Array();