Module: check_mk
Branch: master
Commit: 3e59c1c4a1478189dd29a4bb0306f82d8b71bebc
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3e59c1c4a14781…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Wed Jan 11 11:04:00 2017 +0100
4264 FIX wmic_process: fixed invalid info handling
Change-Id: I04d14f9274b7f01fa33d292ffc23ec1fefd275f8
---
.werks/4264 | 10 ++++++++++
ChangeLog | 1 +
checks/wmic_process | 4 +++-
3 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/.werks/4264 b/.werks/4264
new file mode 100644
index 0000000..52a0b38
--- /dev/null
+++ b/.werks/4264
@@ -0,0 +1,10 @@
+Title: wmic_process: fixed invalid info handling
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.4.0i4
+Date: 1484128972
+
+
diff --git a/ChangeLog b/ChangeLog
index ff7e1d8..ae331d4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -34,6 +34,7 @@
* 4261 FIX: db2_logsizes: fixed wrong discovery condition
* 4262 FIX: wmi_cpuload: fixed missing section handling...
* 4263 FIX: oracle_crs_res: fixed UnboundLocalError; 'crs_nodename'
referenced before assignment...
+ * 4264 FIX: wmic_process: fixed invalid info handling
Multisite:
* 4169 View action: Default values of sticky, notification and persistent options can
now be configured via global settings....
diff --git a/checks/wmic_process b/checks/wmic_process
index 84062f0..ec74d15 100644
--- a/checks/wmic_process
+++ b/checks/wmic_process
@@ -34,7 +34,9 @@ def check_wmic_process(item, params, info):
legend = info[0]
for line in info[1:]:
psinfo = dict(zip(legend, line))
- if "ThreadCount" in legend and psinfo["Name"].lower() ==
"system idle process":
+ if psinfo.get("Name") is None:
+ continue
+ elif "ThreadCount" in legend and psinfo["Name"].lower() ==
"system idle process":
cpucores = int(psinfo["ThreadCount"])
elif psinfo["Name"].lower() == name.lower():
count += 1