Module: check_mk
Branch: master
Commit: db918828513c1ad04604d41ab352c905bc16e665
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=db918828513c1a…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Fri Mar 18 14:00:14 2016 +0100
3013 FIX Inventory: snmp inventory plugins never use cached data
This fixes a bug where inventory data from snmp devices
got cached indefinitely and was never updated.
---
.werks/3013 | 11 +++++++++++
ChangeLog | 1 +
modules/inventory.py | 9 ++++++---
3 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/.werks/3013 b/.werks/3013
new file mode 100644
index 0000000..8c3e2a1
--- /dev/null
+++ b/.werks/3013
@@ -0,0 +1,11 @@
+Title: Inventory: snmp inventory plugins never use cached data
+Level: 1
+Component: inv
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.9i1
+Date: 1458305923
+
+This fixes a bug where inventory data from snmp devices
+got cached indefinitely and was never updated.
diff --git a/ChangeLog b/ChangeLog
index 62986d3..c163cf5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -180,6 +180,7 @@
* 3229 FIX: lnx_distro: SLES based systems have now an OS name inventorized\
* 3265 FIX: mk_inventory.solaris: fix problem on Solaris 10, do prtdiag and prtpicl
only in global zone
* 3289 FIX: Fixed missing filters in HW-/SW-Inventory views after editing the
view...
+ * 3013 FIX: Inventory: snmp inventory plugins never use cached data...
1.2.8b1:
diff --git a/modules/inventory.py b/modules/inventory.py
index 83d2711..f5dcf97 100644
--- a/modules/inventory.py
+++ b/modules/inventory.py
@@ -241,11 +241,14 @@ def do_inv_for(hostname):
for info_type, plugin in inv_info.items():
# Skip SNMP sections that are not supported by this device
- if check_uses_snmp(info_type) and info_type not in snmp_check_types:
- continue
+ use_caches = True
+ if check_uses_snmp(info_type):
+ use_caches = False
+ if info_type not in snmp_check_types:
+ continue
try:
- info = get_info_for_discovery(hostname, ipaddress, info_type,
use_caches=True)
+ info = get_info_for_discovery(hostname, ipaddress, info_type,
use_caches=use_caches)
except Exception, e:
if str(e):
raise # Otherwise simply ignore missing agent section