]> granicus.if.org Git - icinga2/commitdiff
Fix: Downtimes/Comments not being synced to child zones
authorMichael Friedrich <michael.friedrich@netways.de>
Tue, 29 Mar 2016 10:09:51 +0000 (12:09 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Wed, 20 Apr 2016 08:07:24 +0000 (10:07 +0200)
fixes #11227

lib/icinga/comment.cpp
lib/icinga/downtime.cpp

index bbdeb2eeed0e18dd4446be6b1d37d1eea0b54030..b411a4143ac514987506b54790320a7eed406635 100644 (file)
@@ -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();
index b7b17f0e43622f8eb63d3ddb50d10ed0a1d6c046..d7668f79564b9c7ab27d76d3c02aaba3974e1686 100644 (file)
@@ -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();