]> granicus.if.org Git - icinga2/commitdiff
Use "cluster-zone" command to check agent hosts
authorGunnar Beutner <gunnar@beutner.name>
Wed, 29 Oct 2014 06:58:34 +0000 (07:58 +0100)
committerGunnar Beutner <gunnar@beutner.name>
Wed, 29 Oct 2014 06:58:34 +0000 (07:58 +0100)
refs #7248

lib/cli/agentupdateconfigcommand.cpp

index e76b161b99cfb10ef3bec833ba5585abd2091308..b137e6b4269439280362b6cce905a4ab67c57f37 100644 (file)
@@ -118,8 +118,13 @@ int AgentUpdateConfigCommand::Run(const boost::program_options::variables_map& v
                        Dictionary::Ptr host_attrs = make_shared<Dictionary>();
                        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<Array>();
                        host_imports->Add("agent-host"); //default host agent template