Module: check_mk
Branch: master
Commit: c4b0553a3fcb8325bc1ff25243f5b593383c7ba6
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c4b0553a3fcb83…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Nov 6 10:32:50 2015 +0100
#2724 FIX Discovery check: Fixed exception in simulation mode when no cache file present
---
.werks/2724 | 10 ++++++++++
ChangeLog | 1 +
modules/check_mk_base.py | 8 ++++----
3 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/.werks/2724 b/.werks/2724
new file mode 100644
index 0000000..d505179
--- /dev/null
+++ b/.werks/2724
@@ -0,0 +1,10 @@
+Title: Discovery check: Fixed exception in simulation mode when no cache file present
+Level: 1
+Component: core
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i4
+Date: 1446802316
+
+
diff --git a/ChangeLog b/ChangeLog
index a8f4c60..0a0c94b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,7 @@
* 2682 FIX: Fixed exception Error creating configuration: global name
'extra_host_attributes' is not defined
* 2443 FIX: Fixed quoting of ! in classical nagios checks configured via WATO...
* 2718 FIX: Fixed agent timeouts not resulting in a crash report anympore...
+ * 2724 FIX: Discovery check: Fixed exception in simulation mode when no cache file
present
Checks & Agents:
* 2434 NetApp monitoring: Cluster-Mode is now supported, changes in existing 7Mode
checks...
diff --git a/modules/check_mk_base.py b/modules/check_mk_base.py
index ea758c3..6bfce7b 100644
--- a/modules/check_mk_base.py
+++ b/modules/check_mk_base.py
@@ -404,7 +404,8 @@ def get_host_info(hostname, ipaddress, checkname,
max_cachefile_age=None, ignore
#
# This function assumes, that each check type is queried
# only once for each host.
-def get_realhost_info(hostname, ipaddress, check_type, max_cache_age,
ignore_check_interval=False, use_snmpwalk_cache=True):
+def get_realhost_info(hostname, ipaddress, check_type, max_cache_age,
+ ignore_check_interval=False, use_snmpwalk_cache=True):
info = get_cached_hostinfo(hostname)
if info and info.has_key(check_type):
return info[check_type]
@@ -706,11 +707,10 @@ def read_cache_file(relpath, max_cache_age):
(cachefile, cachefile_age(cachefile), max_cache_age))
if simulation_mode and not opt_no_cache:
- raise MKGeneralException("Simulation mode and no cachefile present.")
+ raise MKAgentError("Simulation mode and no cachefile present.")
if opt_no_tcp:
- raise MKGeneralException("Host is unreachable, no usable cache file
present")
- #Cache file '%s' missing or too old. TCP disallowed by you." %
cachefile)
+ raise MKAgentError("Host is unreachable, no usable cache file
present")
def write_cache_file(relpath, output):