Module: check_mk
Branch: master
Commit: af4d518ce5b4b7de694ea5d63e68d740637b9339
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=af4d518ce5b4b7…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Mar 21 10:44:50 2016 +0100
3298 FIX winperf_processor.util: Fixed exception when CPU counters were not matched
---
.werks/3298 | 10 ++++++++++
ChangeLog | 1 +
checks/winperf_processor | 6 +++++-
3 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/.werks/3298 b/.werks/3298
new file mode 100644
index 0000000..01222a0
--- /dev/null
+++ b/.werks/3298
@@ -0,0 +1,10 @@
+Title: winperf_processor.util: Fixed exception when CPU counters were not matched
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.9i1
+Date: 1458553473
+
+
diff --git a/ChangeLog b/ChangeLog
index be4bac0..d58ab9a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -91,6 +91,7 @@
* 3237 FIX: brocade_vdx_status: Fixed broken discovery
* 3238 FIX: if.include: Fixed handling of old-skool traffic limits
* 3104 FIX: ipmi: fixed crash when using summarized output with nagios backend
+ * 3298 FIX: winperf_processor.util: Fixed exception when CPU counters were not
matched
Multisite:
* 3187 notification view: new filter for log command via regex
diff --git a/checks/winperf_processor b/checks/winperf_processor
index 7bdcdc3..3cffe38 100644
--- a/checks/winperf_processor
+++ b/checks/winperf_processor
@@ -59,9 +59,10 @@ def check_winperf_util(_no_item, params, info):
return
wrapped = False
-
+ matched = False
for line in winperf_lines:
if line[0] in what_map:
+ matched = True
what = what_map[line[0]]
# Windows sends one counter for each CPU plus one counter that
# sums up to total (called _Total). We only need that last value.
@@ -121,6 +122,9 @@ def check_winperf_util(_no_item, params, info):
else: # privileged
yield 0, "%s perc: %.1f %%" % (what, used_perc)
+ if not matched:
+ return
+
if wrapped:
# all counters initialized, NOW we can raise the exception
raise MKCounterWrapped("Counter wrap, skipping checks this time")