Module: check_mk
Branch: master
Commit: 25de1be817f5b58bbad9e4d3f01e9bfda35470bc
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=25de1be817f5b5…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Thu Sep 12 13:01:57 2013 +0200
cisco_wlc_clients:
Parameters increased to (crit_low, crit_warn, high_warn, high_crit)
not compatible to older versions! (check first introduced 3 weeks ago)
Add missing check group for cisco_wlc_client
Fixed unused rule group cisco_wlc_clients -> wlc_clients
Updated manpage
Added pnp-template
---
ChangeLog | 3 ++
checkman/cisco_wlc_clients | 6 ++--
checks/cisco_wlc_clients | 21 +++++++++-----
pnp-templates/check_mk-cisco_wlc_clients.php | 39 ++++++++++++++++++++++++++
web/plugins/wato/check_parameters.py | 12 ++++----
5 files changed, 67 insertions(+), 14 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index efbd743..f8dac3e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -85,6 +85,7 @@
is now possible using WATO
* ADD: etherbox: new check for etherbox (messpc) sensors.
currently supported: temperature, humidity, switch contact and smoke sensors
+ * cisco_wlc_client: now supports low/high warn and crit levels
Notifications:
@@ -182,6 +183,8 @@
* FIX: automation snmp scan now adhere rules for shoddy snmp devices
which have no sys description
* ADD: Rule to check state of physical switch (currently used by etherbox check)
+ * FIX: Cisco ruleset "Cisco WLC WiFi client connections" has been
generalized to
+ "WLC WiFi client connections"
Notifications:
* Flexible Notification can now filter service levels
diff --git a/checkman/cisco_wlc_clients b/checkman/cisco_wlc_clients
index 4e05f6c..4ae5418 100644
--- a/checkman/cisco_wlc_clients
+++ b/checkman/cisco_wlc_clients
@@ -19,5 +19,7 @@ inventory:
One check for each wifi network, and one summary check will be created
[parameters]
-warn(int): Optional warning level for the number of clients
-crit(int): Critical level for the number of clients
+crit_low(int): Critical level for minimum number of clients
+warn_low(int): Warning level for minimum number of clients
+warn_high(int): Warning level for maximum number of clients
+crit_high(int): Critical level for maximum number of clients
diff --git a/checks/cisco_wlc_clients b/checks/cisco_wlc_clients
index 01fd893..dd4d72c 100644
--- a/checks/cisco_wlc_clients
+++ b/checks/cisco_wlc_clients
@@ -29,10 +29,9 @@
def inventory_cisco_wlc_clients(info):
if len(info) > 0:
- return [ ('Summary', (None, None) ) ] + [ (x[0], (None, None)) for x in
info ]
+ return [ ('Summary', None ) ] + [ (x[0], None) for x in info ]
def check_cisco_wlc_clients(item, params, info):
- warn, crit = params
state = 0
found = False
for line in info:
@@ -51,11 +50,18 @@ def check_cisco_wlc_clients(item, params, info):
break
if found:
- if crit and num_of_clients > crit:
- state = 2
- elif warn and num_of_clients > warn:
- state = 1
- perf = [ ("clients", num_of_clients, warn, crit ) ]
+ if params:
+ crit_low, warn_low, warn_high, crit_high = params
+ if num_of_clients < crit_low:
+ state = 2
+ elif num_of_clients < warn_low:
+ state = 1
+ elif num_of_clients > crit_high:
+ state = 2
+ elif num_of_clients > warn_high:
+ state = 1
+
+ perf = [ ("clients", num_of_clients, None, None) ]
return state, "%d connections (%s)" % (num_of_clients, interface),
perf
return 3, "WiFi not found"
@@ -64,6 +70,7 @@ check_info["cisco_wlc_clients"] = {
"check_function" : check_cisco_wlc_clients,
"inventory_function" : inventory_cisco_wlc_clients,
"service_description" : "Clients",
+ "group" : "wlc_clients",
"has_perfdata" : True,
"snmp_scan_function" : lambda oid: oid('.1.3.6.1.2.1.1.2.0') in
[".1.3.6.1.4.1.9.1.1069"],
"snmp_info" : ( ".1.3.6.1.4.1.14179.2.1.1.1", [ 2,
42, 38 ]),
diff --git a/pnp-templates/check_mk-cisco_wlc_clients.php
b/pnp-templates/check_mk-cisco_wlc_clients.php
new file mode 100644
index 0000000..9c0c848
--- /dev/null
+++ b/pnp-templates/check_mk-cisco_wlc_clients.php
@@ -0,0 +1,39 @@
+<?php
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2013 mk(a)mathias-kettner.de |
+# +------------------------------------------------------------------+
+#
+# This file is part of Check_MK.
+# The official homepage is at
http://mathias-kettner.de/check_mk.
+#
+# check_mk is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation in version 2. check_mk is distributed
+# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
+# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE. See the GNU General Public License for more de-
+# ails. You should have received a copy of the GNU General Public
+# License along with GNU Make; see the file COPYING. If not, write
+# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA.
+
+
+$opt[1] = "--vertical-label \"Connections\" --title
\"$servicedesc\" ";
+
+$def[1] = "DEF:var1=$RRDFILE[1]:$DS[1]:MAX ";
+$def[1] .= "LINE2:var1#2080ff:\"Connections\:\" ";
+$def[1] .= "GPRINT:var1:LAST:\"%5.1lf%%\" ";
+$def[1] .= "GPRINT:var1:AVERAGE:\"(Avg\: %5.1lf%%,\" ";
+$def[1] .= "GPRINT:var1:MIN:\"Min\: %5.1lf%%,\" ";
+$def[1] .= "GPRINT:var1:MAX:\"Max\: %5.1lf%%)\" ";
+$def[1] .= "HRULE:$CRIT[1]#FFFF00 ";
+$def[1] .= "HRULE:$WARN[1]#FF0000 ";
+$def[1] .= "HRULE:$MIN[1]#FFFF00 ";
+$def[1] .= "HRULE:$MAX[1]#FF0000 ";
+?>
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index 8d1a6fc..58fe698 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -1103,14 +1103,16 @@ register_check_parameters(
register_check_parameters(
subgroup_networking,
- "cisco_wlc_clients",
- _("Cisco WLC WiFi client connections"),
+ "wlc_clients",
+ _("WLC WiFi client connections"),
Tuple(
title = _("Number of connections"),
- help = _("Number of connections for a WiFi "),
+ help = _("Number of connections for a WiFi"),
elements = [
- Integer(title = _("Warning if above"), label =
_("connections")),
- Integer(title = _("Critical if above"), label =
_("connections"))
+ Integer(title = _("Critical if below"),
unit=_("connections")),
+ Integer(title = _("Warning if below"),
unit=_("connections")),
+ Integer(title = _("Warning if above"),
unit=_("connections")),
+ Integer(title = _("Critical if above"),
unit=_("connections")),
]
),
TextAscii( title = _("Name of Wifi")),