From 65018fb75b5bf7bc73dfd81b7f28d449dded0370 Mon Sep 17 00:00:00 2001 From: Jean Flach Date: Tue, 24 Nov 2015 14:32:07 +0100 Subject: [PATCH] Fix master zone name fixes #10716 --- lib/cli/nodeutility.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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 */