From: Jean Flach Date: Tue, 24 Nov 2015 13:32:07 +0000 (+0100) Subject: Fix master zone name X-Git-Tag: v2.5.0~704 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7029bb3aeaf2660d312d6e84bf8f602294bfbbb9;p=icinga2 Fix master zone name fixes #10716 --- diff --git a/lib/cli/nodeutility.cpp b/lib/cli/nodeutility.cpp index bd77c2679..fd44710b0 100644 --- a/lib/cli/nodeutility.cpp +++ b/lib/cli/nodeutility.cpp @@ -19,6 +19,7 @@ #include "cli/nodeutility.hpp" #include "cli/clicommand.hpp" +#include "cli/variableutility.hpp" #include "base/logger.hpp" #include "base/application.hpp" #include "base/tlsutility.hpp" @@ -314,6 +315,7 @@ int NodeUtility::GenerateNodeIcingaConfig(const std::vector& endpoi my_zone->Set("__name", zonename); my_zone->Set("__type", "Zone"); my_zone->Set("parent", master_zone_name); //set the master zone as parent + my_zone->Set("// This is the local node", nodename); my_zone->Set("endpoints", my_zone_members); @@ -343,9 +345,11 @@ int NodeUtility::GenerateNodeMasterIcingaConfig(const String& nodename) my_master_zone_members->Add(nodename); - my_master_zone->Set("__name", "master"); + String zonename = VariableUtility::GetVariable("ZoneName"); + + my_master_zone->Set("__name", zonename); my_master_zone->Set("__type", "Zone"); - my_master_zone->Set("// This is the local master zone", "master"); + my_master_zone->Set("// This is the local master zone", zonename); my_master_zone->Set("endpoints", my_master_zone_members); /* store the local config */