From: Gunnar Beutner Date: Wed, 29 Oct 2014 06:58:34 +0000 (+0100) Subject: Use "cluster-zone" command to check agent hosts X-Git-Tag: v2.2.0~202 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=93da4baf8f5d308aafc0050ca255c5743d0254e6;p=icinga2 Use "cluster-zone" command to check agent hosts refs #7248 --- 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