Module: check_mk
Branch: master
Commit: 7c825e2d5d6cc6eb74e7384120c22090bc98bf1d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7c825e2d5d6cc6…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Jul 10 17:17:25 2018 +0200
6342 FIX Fixed degraded SNMP check performance when using SNMP sub checks
When checking a host with SNMP sub checks which normally all get the same data, the
data was fetched multiple times. One time for each subcheck used for monitoring a host.
This resulted in significantly increased check times and time outs. All 1.5 versions
are affected by this issue.
We experienced this issue with a CMCiii device which is normally monitored by a set of
sub checks (cmciii.*).
Change-Id: I83494499ac31fa354b463388068e6551aea36a54
---
.werks/6342 | 18 ++++++++++++++++++
cmk_base/data_sources/snmp.py | 5 +++++
2 files changed, 23 insertions(+)
diff --git a/.werks/6342 b/.werks/6342
new file mode 100644
index 0000000..82c4ec3
--- /dev/null
+++ b/.werks/6342
@@ -0,0 +1,18 @@
+Title: Fixed degraded SNMP check performance when using SNMP sub checks
+Level: 2
+Component: checks
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1531235656
+
+When checking a host with SNMP sub checks which normally all get the same data, the
+data was fetched multiple times. One time for each subcheck used for monitoring a host.
+
+This resulted in significantly increased check times and time outs. All 1.5 versions
+are affected by this issue.
+
+We experienced this issue with a CMCiii device which is normally monitored by a set of
+sub checks (cmciii.*).
diff --git a/cmk_base/data_sources/snmp.py b/cmk_base/data_sources/snmp.py
index dbff296..23bcc0c 100644
--- a/cmk_base/data_sources/snmp.py
+++ b/cmk_base/data_sources/snmp.py
@@ -219,6 +219,11 @@ class SNMPDataSource(DataSource):
self._logger.debug("%s: Skip fetching data (persisted info
exists)" % (check_plugin_name))
continue
+ # Prevent duplicate data fetching of identical section in case of SNMP sub
checks
+ if section_name in info:
+ self._logger.debug("%s: Skip fetching data (section already
fetched)" % (check_plugin_name))
+ continue
+
self._logger.debug("%s: Fetching data" % (check_plugin_name))
# oid_info can now be a list: Each element of that list is interpreted as
one real oid_info