Module: check_mk
Branch: master
Commit: b7baff16bfc5bdbb70d0aa5638ca8a91bd0726b1
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b7baff16bfc5bd…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Jun 17 16:00:46 2013 +0200
FIX: winperf_processor: fix case where CPU percent is exactly 100%
Conflicts:
ChangeLog
---
ChangeLog | 5 +++++
checks/winperf_processor | 21 +++++++++------------
2 files changed, 14 insertions(+), 12 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 3daa9f6..1400b9f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -180,6 +180,11 @@
* Remove Notification Command user settings, please use flexible notifications
instead
+1.2.2p3:
+ Checks & Agents:
+ * FIX: winperf_processor: fix case where CPU percent is exactly 100%
+
+
1.2.2p2:
Core:
* FIX: livecheck: fixed handling of one-line plugin outputs and missing \n
diff --git a/checks/winperf_processor b/checks/winperf_processor
index 140ed02..75fd9e8 100644
--- a/checks/winperf_processor
+++ b/checks/winperf_processor
@@ -50,18 +50,15 @@ def check_winperf_util(_no_item, params, info):
ticks = int(line[-2])
num_cpus = len(line) - 3
timedif, ticks_per_sec = get_counter("winperf_util", this_time,
ticks)
- if ticks_per_sec == 0.0:
- used_perc = 0.0
- else:
- # We get the value of the PERF_100NSEC_TIMER_INV here.
- # This counter type shows the average percentage of active time observed
- # during the sample interval. This is an inverse counter. Counters of
this
- # type calculate active time by measuring the time that the service was
- # inactive and then subtracting the percentage of active time from 100
percent.
- #
- # 1 tick = 100ns, convert to seconds
- cpusecs_per_sec = ticks_per_sec / 10000000.0
- used_perc = 100 * (1 - cpusecs_per_sec)
+ # We get the value of the PERF_100NSEC_TIMER_INV here.
+ # This counter type shows the average percentage of active time observed
+ # during the sample interval. This is an inverse counter. Counters of this
+ # type calculate active time by measuring the time that the service was
+ # inactive and then subtracting the percentage of active time from 100
percent.
+ #
+ # 1 tick = 100ns, convert to seconds
+ cpusecs_per_sec = ticks_per_sec / 10000000.0
+ used_perc = 100.0 * (1 - cpusecs_per_sec)
# Due to timeing invariancies the measured level can become > 100%.
# This makes users unhappy, so cut it off.