Module: check_mk
Branch: master
Commit: bb0c68a8ff28c331579d4c1a16db8150d28e67ad
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=bb0c68a8ff28c3…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Nov 29 11:01:58 2016 +0100
4078 FIX Fixed handling of hosts with non resolvable IP addresses during runtime
Hosts which only have a hostname configured that IP address is resolved during
configuration creation. When a host could not be resolved it is added to the
monitoring with the 0.0.0.0 or :: address.
That lead to some checks monitoring the local host accidentally.
---
.werks/4078 | 13 +++++++++++++
ChangeLog | 1 +
modules/check_mk_base.py | 3 +++
3 files changed, 17 insertions(+)
diff --git a/.werks/4078 b/.werks/4078
new file mode 100644
index 0000000..0eca23c
--- /dev/null
+++ b/.werks/4078
@@ -0,0 +1,13 @@
+Title: Fixed handling of hosts with non resolvable IP addresses during runtime
+Level: 1
+Component: core
+Compatible: compat
+Version: 1.4.0i3
+Date: 1480413611
+Class: fix
+
+Hosts which only have a hostname configured that IP address is resolved during
+configuration creation. When a host could not be resolved it is added to the
+monitoring with the 0.0.0.0 or :: address.
+
+That lead to some checks monitoring the local host accidentally.
diff --git a/ChangeLog b/ChangeLog
index 15b16c6..a38cc2d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
1.4.0i3:
Core & Setup:
* 3978 FIX: mkbackup: Fixed backup to some CIFS shares ([Errno 13] Permission denied)
'...')...
+ * 4078 FIX: Fixed handling of hosts with non resolvable IP addresses during
runtime...
Checks & Agents:
* 3988 Windows agent: new global option disabled_sections...
diff --git a/modules/check_mk_base.py b/modules/check_mk_base.py
index 3f58475..5845646 100644
--- a/modules/check_mk_base.py
+++ b/modules/check_mk_base.py
@@ -679,6 +679,9 @@ def write_cache_file(relpath, output):
# In that case it will be looked up if needed. Also caching will
# be handled here
def get_agent_info(hostname, ipaddress, max_cache_age):
+ if ipaddress in [ "0.0.0.0", "::" ]:
+ raise MKAgentError("Failed to lookup IP address and no explicit IP address
configured")
+
output = read_cache_file(hostname, max_cache_age)
if not output:
# Try to contact every host only once