Module: check_mk
Branch: master
Commit: e7fd150ac637ce3cbf10512c73a01d6cf73ec77f
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e7fd150ac637ce…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Apr 24 11:15:23 2014 +0200
FIX Fix SNMP inventory check in simulation mode
---
.werks/888 | 9 +++++++++
ChangeLog | 1 +
modules/check_mk_base.py | 8 +++++++-
3 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/.werks/888 b/.werks/888
new file mode 100644
index 0000000..7890767
--- /dev/null
+++ b/.werks/888
@@ -0,0 +1,9 @@
+Title: Fix SNMP inventory check in simulation mode
+Level: 1
+Component: core
+Class: fix
+State: unknown
+Version: 1.2.5i3
+Date: 1398330909
+
+
diff --git a/ChangeLog b/ChangeLog
index c839d17..61b25d0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,7 @@
* 0884 New options --oid and --extraoid for cmk --snmpwalk...
* 0785 FIX: Availability: fixed memory leak in table statehist...
* 0903 FIX: availability: fixed bug causing the availability feature not considering
timeperiod transitions
+ * 0888 FIX: Fix SNMP inventory check in simulation mode
Checks & Agents:
* 0149 cisco_secure: New check for Port Security on Cisco swichtes
diff --git a/modules/check_mk_base.py b/modules/check_mk_base.py
index 90e839d..e57a3e7 100644
--- a/modules/check_mk_base.py
+++ b/modules/check_mk_base.py
@@ -351,7 +351,13 @@ def get_realhost_info(hostname, ipaddress, check_type, max_cache_age,
ignore_che
# cache file is newer than check_interval, skip this check
raise MKSkipCheck()
- content = read_cache_file(cache_relpath, max_cache_age)
+ try:
+ content = read_cache_file(cache_relpath, max_cache_age)
+ except:
+ if simulation_mode and not opt_no_cache:
+ return # Simply ignore missing SNMP cache files
+ raise
+
if content:
return eval(content)
# Not cached -> need to get info via SNMP