Module: check_mk
Branch: master
Commit: 278d6ae0fe8d82b58e26252317bae29e9fb57f03
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=278d6ae0fe8d82…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Jan 26 14:15:02 2016 +0100
#2961 FIX tsm_sessions: Fixed crash in cae of client name contains spaces
---
.werks/2961 | 9 +++++++++
ChangeLog | 1 +
checks/tsm_sessions | 9 ++++++++-
3 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/.werks/2961 b/.werks/2961
new file mode 100644
index 0000000..c01fde5
--- /dev/null
+++ b/.werks/2961
@@ -0,0 +1,9 @@
+Title: tsm_sessions: Fixed crash in cae of client name contains spaces
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i4
+Date: 1453814076
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index 7e6ff5b..c3964d7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -220,6 +220,7 @@
* 2958 FIX: domino_tasks: Fixed broken discovery and check
* 2959 FIX: apt: Made check more robust against invalid agent data
* 2960 FIX: tsm_stagingpools: Fixed exception in case of garbled agent output
+ * 2961 FIX: tsm_sessions: Fixed crash in cae of client name contains spaces
Multisite:
* 2684 Added icons for downloading agent data / walks of hosts...
diff --git a/checks/tsm_sessions b/checks/tsm_sessions
index 043f966..322c8ae 100644
--- a/checks/tsm_sessions
+++ b/checks/tsm_sessions
@@ -39,8 +39,15 @@ def check_tsm_sessions(item, params, info):
for entry in info:
if len(entry) == 4:
sid, client_name, proc_state, wait = entry
+
+ elif len(entry) > 4:
+ sid = entry[0]
+ proc_state, wait = entry[-2:]
+ client_name = " ".join(entry[1:-2])
+
else:
sid, proc_state, wait = entry
+
if proc_state in ['RecvW', 'MediaW']:
wait = saveint(wait)
if wait >= crit:
@@ -49,7 +56,7 @@ def check_tsm_sessions(item, params, info):
elif wait >= warn:
state = max(state, 1)
count += 1
- return state, "%d sessions to long in RecvW or MediaW state" % count
+ return state, "%d sessions too long in RecvW or MediaW state" % count
check_info["tsm_sessions"] = {