Module: check_mk
Branch: master
Commit: c7cf577e0b8a626d9fb962ba9f39bb2b941e1ac6
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c7cf577e0b8a62…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Thu Jun 8 11:36:22 2017 +0200
4774 FIX wmi_cpuload: Expanded missing information handling
Change-Id: I7180a004806c112d5bb5a6396fb4b81cd72e8022
---
.werks/4774 | 11 +++++++++++
checks/wmi_cpuload | 13 ++++++-------
2 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/.werks/4774 b/.werks/4774
new file mode 100644
index 0000000..5323d48
--- /dev/null
+++ b/.werks/4774
@@ -0,0 +1,11 @@
+Title: wmi_cpuload: Expanded missing information handling
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i1
+Date: 1496914500
+
+
diff --git a/checks/wmi_cpuload b/checks/wmi_cpuload
index d120721..954dce7 100644
--- a/checks/wmi_cpuload
+++ b/checks/wmi_cpuload
@@ -36,15 +36,14 @@ def check_wmi_cpuload(item, params, parsed):
# unlike cpu load this does not include processes currently being processed,
# so unless to cpu is (almost) fully utilized, this will be 0.
- load = int(parsed["system_perf"].get(0,
"ProcessorQueueLength"))
- this_time = get_wmi_time(parsed["system_perf"], 0)
- load5min = get_average("load_5min", this_time, load, 5)
- load15min = get_average("load_15min", this_time, load, 15)
-
try:
+ load = int(parsed["system_perf"].get(0,
"ProcessorQueueLength"))
+ this_time = get_wmi_time(parsed["system_perf"], 0)
+ load5min = get_average("load_5min", this_time, load, 5)
+ load15min = get_average("load_15min", this_time, load, 15)
computer_system = parsed["computer_system"]
- except KeyError:
- return 3, "Missing information from agent"
+ except KeyError, e:
+ return 3, "Missing information from agent: %s" % e
try:
cores = int(computer_system.get(0, "NumberOfLogicalProcessors"))