Module: check_mk
Branch: master
Commit: 4017f149b37acdc61b5ce1e5e8f63e644c3fecd8
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4017f149b37acd…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Sun Apr 21 19:45:01 2019 +0200
Cleanup fragments of ancient host alias configuration
CMK-2030
Change-Id: I54fb25c1f210e93961a38d2eefb1aef1a264f4c0
---
cmk_base/core_nagios.py | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/cmk_base/core_nagios.py b/cmk_base/core_nagios.py
index 6ef770b..336ccc4 100644
--- a/cmk_base/core_nagios.py
+++ b/cmk_base/core_nagios.py
@@ -191,11 +191,11 @@ def _create_nagios_host_spec(cfg, config_cache, hostname, attrs):
# | |
# |_| 1. normal, physical hosts
- alias = hostname
host_spec = {
"host_name": hostname,
"use": config.cluster_template if is_clust else config.host_template,
"address": ip if ip else core_config.fallback_ip_for(host_config),
+ "alias": attrs["alias"],
}
# Add custom macros
@@ -243,14 +243,8 @@ def _create_nagios_host_spec(cfg, config_cache, hostname, attrs):
elif is_clust:
# Special handling of clusters
- alias = "cluster of %s" % ", ".join(nodes)
host_spec["parents"] = ",".join(nodes)
- # Output alias, but only if it's not defined in extra_host_conf
- alias = config.alias_of(hostname, None)
- if alias is not None:
- host_spec["alias"] = alias
-
# Custom configuration last -> user may override all other values
host_spec.update(
_extra_host_conf_of(config_cache, hostname, exclude=["parents"] if
is_clust else []))