From 93da4baf8f5d308aafc0050ca255c5743d0254e6 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Wed, 29 Oct 2014 07:58:34 +0100 Subject: [PATCH] Use "cluster-zone" command to check agent hosts refs #7248 --- lib/cli/agentupdateconfigcommand.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/cli/agentupdateconfigcommand.cpp b/lib/cli/agentupdateconfigcommand.cpp index e76b161b9..b137e6b42 100644 --- a/lib/cli/agentupdateconfigcommand.cpp +++ b/lib/cli/agentupdateconfigcommand.cpp @@ -118,8 +118,13 @@ int AgentUpdateConfigCommand::Run(const boost::program_options::variables_map& v Dictionary::Ptr host_attrs = make_shared(); host_attrs->Set("__name", host); host_attrs->Set("name", host); - host_attrs->Set("check_command", "dummy"); - host_attrs->Set("zone", zone); + + if (host == zone) + host_attrs->Set("check_command", "cluster-zone"); + else { + host_attrs->Set("check_command", "dummy"); + host_attrs->Set("zone", zone); + } Array::Ptr host_imports = make_shared(); host_imports->Add("agent-host"); //default host agent template -- 2.40.0