Module: check_mk
Branch: master
Commit: d592bf2ef9773608d800f6ffb1a269a983495707
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d592bf2ef97736…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Apr 19 15:39:36 2016 +0200
3387 FIX ps: Fixed crash during service discovery on AIX hosts having defunct processes
---
.werks/3387 | 10 ++++++++++
ChangeLog | 1 +
checks/ps.include | 6 +++++-
3 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/.werks/3387 b/.werks/3387
new file mode 100644
index 0000000..2463950
--- /dev/null
+++ b/.werks/3387
@@ -0,0 +1,10 @@
+Title: ps: Fixed crash during service discovery on AIX hosts having defunct processes
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.9i1
+Date: 1461073126
+
+
diff --git a/ChangeLog b/ChangeLog
index c382827..dafbd35 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -162,6 +162,7 @@
* 3400 FIX: local: do not crash in P mode if performance data contains a unit of
measurement
* 3386 FIX: AIX agent: Cached local scripts / plugins need to be configured in
seconds...
NOTE: Please refer to the migration notes!
+ * 3387 FIX: ps: Fixed crash during service discovery on AIX hosts having defunct
processes
Multisite:
* 3187 notification view: new filter for log command via regex
diff --git a/checks/ps.include b/checks/ps.include
index 98093aa..45748f8 100644
--- a/checks/ps.include
+++ b/checks/ps.include
@@ -185,7 +185,11 @@ def process_matches_for_discovery(process_line, process_pattern,
userspec):
if matchobject:
return [ g and g or "" for g in matchobject.groups() ],
grabbed_user
else:
- if command_line[0] == process_pattern:
+ # command_line can be empty. Found in AIX agent output (server-aix-ps-1):
+ # ...
+ # (<defunct>,,,)
+ # ...
+ if command_line and command_line[0] == process_pattern:
return (), grabbed_user
return False, grabbed_user