Module: check_mk
Branch: master
Commit: 936a0c74feaeb4a181b41dc0ec6aebeccd05172d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=936a0c74feaeb4…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sat Oct 17 13:31:31 2015 +0200
#2665 FIX ps: fix crash in case of quota violation on Windows
---
.werks/2665 | 10 ++++++++++
ChangeLog | 3 ++-
checks/ps | 10 +++++++++-
3 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/.werks/2665 b/.werks/2665
new file mode 100644
index 0000000..1f08202
--- /dev/null
+++ b/.werks/2665
@@ -0,0 +1,10 @@
+Title: ps: fix crash in case of quota violation on Windows
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i4
+Date: 1445081461
+
+
diff --git a/ChangeLog b/ChangeLog
index c45a402..5d54841 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,8 +6,9 @@
* 2663 knuerr_rms_temp: switch to new generic temperature logic, allow e.g. lower
levels...
NOTE: Please refer to the migration notes!
* 2660 FIX: fixed windows agent using the wrong working directory...
- * 2661 FIX: windows agent: fixed incomplete process list...
* 2664 FIX: ps: Speedup in situation with many matching processes...
+ * 2661 FIX: windows agent: fixed incomplete process list...
+ * 2665 FIX: ps: fix crash in case of quota violation on Windows
Multisite:
* 2680 FIX: LDAP: Fixed exception when syncing groups using configurations from
previous versions...
diff --git a/checks/ps b/checks/ps
index c4affac..75e5799 100644
--- a/checks/ps
+++ b/checks/ps
@@ -111,7 +111,15 @@ def parse_ps(info):
ps_result.append(line)
else:
row = dict(zip(wmic_headers, line))
- wmic_info[(row["node"], row["Name"],
row["ProcessId"])] = row
+ # Row might be damaged. I've seen this agent output:
+ # Node - TILE-BUILDER02
+ # ERROR:
+ # Description = Quota violation
+ #
+ # Node,
+ if "Name" in row and "ProcessId" in row:
+ wmic_info[(row["node"], row["Name"],
row["ProcessId"])] = row
+
except StopIteration:
pass