Module: check_mk
Branch: master
Commit: 1e05f308896a155629b525285437abda456dace1
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1e05f308896a15…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Jul 28 15:47:20 2014 +0200
#1142 FIX winperf_ts_sessions: fix computation, check has never really worked
---
.werks/1142 | 9 +++++++++
ChangeLog | 1 +
checks/winperf_ts_sessions | 10 +++++-----
3 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/.werks/1142 b/.werks/1142
new file mode 100644
index 0000000..bf500e3
--- /dev/null
+++ b/.werks/1142
@@ -0,0 +1,9 @@
+Title: winperf_ts_sessions: fix computation, check has never really worked
+Level: 1
+Component: checks
+Class: fix
+State: unknown
+Version: 1.2.5i6
+Date: 1406555200
+
+
diff --git a/ChangeLog b/ChangeLog
index 5f92d9f..4ca5388 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
1.2.5i6:
Checks & Agents:
* 1051 FIX: tcp_conn_stats: fix missing performance data...
+ * 1142 FIX: winperf_ts_sessions: fix computation, check has never really worked
1.2.5i5:
diff --git a/checks/winperf_ts_sessions b/checks/winperf_ts_sessions
index 0498ceb..113abf6 100644
--- a/checks/winperf_ts_sessions
+++ b/checks/winperf_ts_sessions
@@ -31,7 +31,7 @@
# 4 1 rawcount
# 6 0 rawcount
-# Counters, relative to the base ID (2102)
+# Counters, relative to the base ID (e.g. 2102)
# 2 Total number of Terminal Services sessions.
# 4 Number of active Terminal Services sessions.
# 6 Number of inactive Terminal Services sessions.
@@ -43,7 +43,7 @@ def inventory_winperf_ts_sessions(info):
def check_winperf_ts_sessions(_unused, params, info):
if not info or len(info) == 1:
return 3, "Performance counters not available"
- total, active, inactive = [ int(l[0]) for l in info[1:4] ]
+ total, active, inactive = [ int(l[1]) for l in info[1:4] ]
state = 0
state_txt = []
@@ -52,11 +52,11 @@ def check_winperf_ts_sessions(_unused, params, info):
txt = '%d %s' % (val, title)
if key in params:
if val > params[key][0]:
- state = max(state, 2)
- txt += ' (!!)'
+ state = 2
+ txt += '(!!)'
elif val > params[key][1]:
state = max(state, 1)
- txt += ' (!)'
+ txt += '(!)'
state_txt.append(txt)
perfdata = [ ('active', active, ), ('inactive', inactive) ]