Module: check_mk
Branch: master
Commit: bcc473cda542e83507776a5bb498deec3f930962
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=bcc473cda542e8…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Apr 24 18:00:38 2019 +0200
Nagios core: Fix creating default hostgroup if needed
Change-Id: I3ce0e84497827ac5bdbce2da1815d6d714959c1d
---
cmk_base/core_nagios.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cmk_base/core_nagios.py b/cmk_base/core_nagios.py
index 6130c95..e5f1fbe 100644
--- a/cmk_base/core_nagios.py
+++ b/cmk_base/core_nagios.py
@@ -210,7 +210,7 @@ def _create_nagios_host_spec(cfg, config_cache, hostname, attrs):
host_spec["check_command"] = command
hostgroups = host_config.hostgroups
- if config.define_hostgroups:
+ if config.define_hostgroups or hostgroups == [config.default_host_group]:
cfg.hostgroups_to_define.update(hostgroups)
host_spec["hostgroups"] = ",".join(hostgroups)