Module: check_mk
Branch: master
Commit: dc5c312508c2acd5d74d404580b33fe7ea818afc
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=dc5c312508c2ac…
Author: Konstantin Büttner <kb(a)mathias-kettner.de>
Date: Mon Dec 12 14:19:44 2016 +0100
4101 FIX citrix_sessions: Output error message in case of missing session information.
Previously, this check would crash.
Change-Id: Ie479b9f55419fb83fdc2bf09e923279c459c7978
---
.werks/4101 | 10 ++++++++++
ChangeLog | 1 +
checks/citrix_sessions | 4 ++++
3 files changed, 15 insertions(+)
diff --git a/.werks/4101 b/.werks/4101
new file mode 100644
index 0000000..9c14b48
--- /dev/null
+++ b/.werks/4101
@@ -0,0 +1,10 @@
+Title: citrix_sessions: Output error message in case of missing session information.
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.4.0i3
+Date: 1481548731
+
+Previously, this check would crash.
diff --git a/ChangeLog b/ChangeLog
index e0515c9..ee85fa3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -57,6 +57,7 @@
* 4001 FIX: Windows Agent: windows agent couldn't handle surrounding quotes and
spaces at command specification...
* 4138 FIX: statgrab: Fixed issue in FreeBSD agent when statgrab is not installed
* 4158 FIX: fileinfo: fixed file handling containing spaces
+ * 4101 FIX: citrix_sessions: Output error message in case of missing session
information....
Multisite:
* 4070 Added a painter for the service check period
diff --git a/checks/citrix_sessions b/checks/citrix_sessions
index 113dd5a..f3c29a7 100644
--- a/checks/citrix_sessions
+++ b/checks/citrix_sessions
@@ -38,6 +38,10 @@ def inventory_citrix_sessions(info):
return [ ( None, "citrix_sessions_default_levels" )]
def check_citrix_sessions(_no_item, params, info):
+
+ if map(len, info) == [1, 1, 1]:
+ return 3, "Could not collect session information. Please check the agent
configuration."
+
session = {}
session['total'], session['active'], session['inactive'] = \
map(int, (info[0][1], info[1][1], info[2][1]))