From d0b5898c469fafb5274977c70e499eaee174e4c9 Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Tue, 29 Mar 2016 12:09:51 +0200 Subject: [PATCH] Fix: Downtimes/Comments not being synced to child zones fixes #11227 --- lib/icinga/comment.cpp | 5 +++++ lib/icinga/downtime.cpp | 5 +++++ 2 files changed, 10 insertions(+) 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();