Module: check_mk
Branch: master
Commit: fcbc22d992d8c6b6e2adbc9dd8a748a02a6c5df1
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=fcbc22d992d8c6…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Tue Aug 11 17:43:31 2015 +0200
#2516 check juniper_trpz_aps: now lists also the sessions on the access points
Now this check shows the total number of access points and sessions on the access points.
Furthermore the check lists the access points and related sessions per node.
---
.werks/2516 | 10 ++++++++++
ChangeLog | 1 +
checkman/juniper_trpz_aps | 9 +++++++--
checks/juniper_trpz_aps | 33 +++++++++++++++++++++------------
4 files changed, 39 insertions(+), 14 deletions(-)
diff --git a/.werks/2516 b/.werks/2516
new file mode 100644
index 0000000..d3aba74
--- /dev/null
+++ b/.werks/2516
@@ -0,0 +1,10 @@
+Title: check juniper_trpz_aps: now lists also the sessions on the access points
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i3
+Date: 1439307683
+Class: feature
+
+Now this check shows the total number of access points and sessions on the access
points.
+Furthermore the check lists the access points and related sessions per node.
diff --git a/ChangeLog b/ChangeLog
index d97e7b6..2d52dde 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -42,6 +42,7 @@
* 1277 check_ldap: It is now possible to specify a alternative Hostname...
* 1278 mssql_blocked_sessions: New Check to show blocked MSSQL Sessions
* 1279 check_curl (treasures): Added NTLM support
+ * 2516 check juniper_trpz_aps: now lists also the sessions on the access points...
* 2315 FIX: windows agent: BOM replacement, fixed incorrect byte offset...
* 2316 FIX: windows agent: fix garbled output of cached agent plugins...
* 2358 FIX: check_mk_agent.solaris: more correct computation of zfs used space...
diff --git a/checkman/juniper_trpz_aps b/checkman/juniper_trpz_aps
index 4bf762f..d357845 100644
--- a/checkman/juniper_trpz_aps
+++ b/checkman/juniper_trpz_aps
@@ -4,8 +4,13 @@ catalog: hw/network/juniper
license: GPL
distribution: check_mk
description:
- Show the number of online access points registered on the controller.
- This check is now cluster-aware.
+ Shows the number of online access points registered on the controller
+ and the sessions on the access point.
+
+ This check is now cluster-aware: Displays the total number of active
+ access points and the total number of sessions on these access points.
+ Furthermore this check lists the online access points and related sessions
+ per node.
inventory:
One service for the number of access points
diff --git a/checks/juniper_trpz_aps b/checks/juniper_trpz_aps
index acc3c15..cfeca3e 100644
--- a/checks/juniper_trpz_aps
+++ b/checks/juniper_trpz_aps
@@ -28,28 +28,37 @@ def inventory_juniper_trpz_aps(info):
return [ (None, None) ]
def check_juniper_trpz_aps(_no_item, _no_params, info):
- aps_sum = 0
+ total_aps = 0
+ total_sessions = 0
message = ""
- for node, aps in info:
- aps_sum += int(aps)
- message += "%s access points online" % aps
-
+ for node, aps, sessions in info:
# Are we a cluster?
if node != None:
- message += " (on %s)," % node
+ message += "%s: " % node
+
+ total_aps += int(aps)
+ total_sessions += int(sessions)
+ message += "%s access points online, %s sessions - " % (aps, sessions)
+
+ if message.endswith(' - '):
+ message = message[:-3]
- if message.endswith(','):
- message = message[:-1]
+ if len(info) > 1:
+ infotext = "Total: %d access points, %d sessions (%s)" % (total_aps,
total_sessions, message)
+ else:
+ infotext = message
- return 0, message, [ ('ap_devices_total', aps_sum) ]
+ return 0, infotext, [ ('ap_devices_total', total_aps),
("total_sessions", total_sessions) ]
check_info["juniper_trpz_aps"] = {
"check_function" : check_juniper_trpz_aps,
"inventory_function" : inventory_juniper_trpz_aps,
"service_description" : "Access Points",
"node_info" : True,
+ "has_perfdata" : True,
"snmp_scan_function" : lambda oid:
oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.14525.3.1"),
- "snmp_info" : (".1.3.6.1.4.1.14525.4.5.1.1",[
- 1, #number of Access Points
- ])
+ "snmp_info" : (".1.3.6.1.4.1.14525.4", [
+ "5.1.1.1", # number of active access
points
+ "4.1.1.4", # number of sessions on active
access points
+ ]),
}