Module: check_mk
Branch: master
Commit: 8b29f838047e0f7dd6c383f8d4c431372b9504b7
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8b29f838047e0f…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Dec 9 17:24:42 2014 +0100
#1751 FIX winperf_ts_sessions: try to fix invalid number of active and inactive sessions
M$ seems to have changed the order of the performance counters in newer OS versions
(horray!). We try to compensate for that by doing some computations.
---
.werks/1751 | 10 ++++++++++
ChangeLog | 1 +
checkman/winperf_ts_sessions | 4 ++--
checks/winperf_ts_sessions | 12 +++++++++---
4 files changed, 22 insertions(+), 5 deletions(-)
diff --git a/.werks/1751 b/.werks/1751
new file mode 100644
index 0000000..45ca05a
--- /dev/null
+++ b/.werks/1751
@@ -0,0 +1,10 @@
+Title: winperf_ts_sessions: try to fix invalid number of active and inactive sessions
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.5i7
+Date: 1418142192
+Class: fix
+
+M$ seems to have changed the order of the performance counters in newer OS versions
+(horray!). We try to compensate for that by doing some computations.
diff --git a/ChangeLog b/ChangeLog
index ee57b1f..b21a2c7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -158,6 +158,7 @@
* 1736 FIX: lparstat_aix: Trying to deal with more kind of lparstat output...
* 1737 FIX: mk_sap: Working around garbled SAP state file when multiple instances
were running parallel
* 1738 FIX: oracle_instance: Be compatible to old oracle agent outputs
+ * 1751 FIX: winperf_ts_sessions: try to fix invalid number of active and inactive
sessions...
Multisite:
* 1508 Allow input of plugin output and perfdata when faking check results...
diff --git a/checkman/winperf_ts_sessions b/checkman/winperf_ts_sessions
index f55db18..e2d10eb 100644
--- a/checkman/winperf_ts_sessions
+++ b/checkman/winperf_ts_sessions
@@ -8,11 +8,11 @@ description:
Server Sessions using the windows performance counters (agent section
{<<<winperf_ts_sessions>>>}).
- To make this check work, you need to configure the agent via it's .ini
+ To make this check work, you need to configure the agent via it's
<tt>check_mk.ini</tt>
file to forward the terminal service session related counters. Take a
look at the windows monitoring documentation for details.
- It allows to set {WARN} and {CRIT} tresholds on the active and idle session.
+ It allows to set WARN and CRIT tresholds on the active and idle session.
inventory:
The check generates service per host.
diff --git a/checks/winperf_ts_sessions b/checks/winperf_ts_sessions
index 8866f98..a1846bc 100644
--- a/checks/winperf_ts_sessions
+++ b/checks/winperf_ts_sessions
@@ -27,9 +27,9 @@
# Example output from agent:
# <<<winperf_ts_sessions>>>
# 1385714515.93 2102
-# 2 1 rawcount
-# 4 1 rawcount
-# 6 0 rawcount
+# 2 20 rawcount
+# 4 18 rawcount
+# 6 2 rawcount
# Counters, relative to the base ID (e.g. 2102)
# 2 Total number of Terminal Services sessions.
@@ -45,6 +45,12 @@ def check_winperf_ts_sessions(_unused, params, info):
return 3, "Performance counters not available"
total, active, inactive = [ int(l[1]) for l in info[1:4] ]
+ # Tom Moore said, that the order of the columns has recently changed
+ # in newer Windows versions (hooray!) and is now active, inactive, total.
+ # We try to accomodate for that.
+ if active + inactive != total:
+ active, inactive, total = total, active, inactive
+
state = 0
state_txt = []
for val, key, title in [ (active, 'active', 'Active'),