Module: check_mk
Branch: master
Commit: 1123f9ba3330c98fcd4728853d66b360b3a28a86
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1123f9ba3330c9…
Author: Götz Golla <gg(a)mathias-kettner.de>
Date: Mon Jan 13 13:07:01 2014 +0100
f5_bigip_conns: new check to monitor number of current connections
---
.werks/79 | 7 +++
ChangeLog | 1 +
checkman/f5_bigip_conns | 34 ++++++++++++++
checks/f5_bigip_conns | 83 ++++++++++++++++++++++++++++++++++
web/plugins/wato/check_parameters.py | 29 ++++++++++++
5 files changed, 154 insertions(+)
diff --git a/.werks/79 b/.werks/79
new file mode 100644
index 0000000..ad5ea3f
--- /dev/null
+++ b/.werks/79
@@ -0,0 +1,7 @@
+Title: f5_bigip_conns: new check to monitor number of current connections
+Level: 1
+Component: checks
+Version: 1.2.5i1
+Date: 1389614781
+Class: feature
+
diff --git a/ChangeLog b/ChangeLog
index a411a03..4e1b87d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -37,6 +37,7 @@
* 0077 cmciii.psm_current, cmciii_psm_plugs, cmciii_io, cmciii.access, cmciii.temp,
cmciii.can_current, cmciii.sensor, cmciii.state: new sub checks included in one new check
cmcmiii superseding and improving several previous checks of the Rittal CMCIII device...
NOTE: Please refer to the migration notes!
* 0078 job: check now monitors the time since last start of the job, limits can be
configured in WATO
+ * 0079 f5_bigip_conns: new check to monitor number of current connections
* 0103 FIX: services: Fixed bug with service inventory defined in main.mk...
* 0299 FIX: borcade_mlx_fan: Prettified output, handling "other" state now
* 0300 FIX: cisco_fru_power: Trying not to inventorize not plugged in FRUs...
diff --git a/checkman/f5_bigip_conns b/checkman/f5_bigip_conns
new file mode 100644
index 0000000..6629dd8
--- /dev/null
+++ b/checkman/f5_bigip_conns
@@ -0,0 +1,34 @@
+title: F5 Big-IP: number of current connections
+agents: snmp
+catalog: hw/network/f5
+license: GPL
+distribution: check_mk
+description:
+ The check queries the MIB tables of F5 BIG-IP loadbalancers (local traffic managers)
+ for the number of current connections and the number of current ssl connections.
+
+ It supports devices running the 9.0 and above releases of the F5 OS. It's tested
against 9.3
+ devices.
+
+ Warning and critical limits can be given for both types of data.
+
+ The check is supported by WATO.
+
+inventory:
+ The check has two items per host, the number of connections, and the number of ssl
connections
+
+perfdata:
+ The value: the number of current connections
+
+[parameters]
+parameters(dict): parameters is a dictionary with two keys
+
+ {"conns"}: the number of connections from {sysStatClientCurConns }
+
+ {"sslconns"}: the number of ssl connections from {sysClientsslStatCurConns }
+
+[configuration]
+f5_bigip_conns_default_levels(dict): This variable is preset to {{ "conns": (
25000, 30000 ) }, "sslconns": ( 25000, 30000 )}
+
+
+
diff --git a/checks/f5_bigip_conns b/checks/f5_bigip_conns
new file mode 100644
index 0000000..09e6eb1
--- /dev/null
+++ b/checks/f5_bigip_conns
@@ -0,0 +1,83 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | 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.
+
+
+# {iso(1) identified-organization(3) dod(6) internet(1) private(4) enterprise(1) 3375
bigipTrafficMgmt(2) bigipSystem(1) sysGlobals(1) sysGlobalStats(2) sysGlobalStat(1)
sysStatClientCurConns(8)}
+
+# {iso(1) identified-organization(3) dod(6) internet(1) private(4) enterprise(1) 3375
bigipTrafficMgmt(2) bigipSystem(1) sysGlobals(1) sysGlobalStats(2)
sysGlobalClientSslStat(9) sysClientsslStatCurConns(2)}
+
+
+# f5_bigip_conns_default_levels = ( 25000, 30000 )
+factory_settings["f5_bigip_conns_default_levels"] = {
+ "conns": ( 25000, 30000 ),
+ "sslconns": ( 25000, 30000 ),
+}
+
+
+def inventory_f5_bigip_conns(info):
+ inventory = []
+ if info[0][0]:
+ inventory.append( ( "Open Connections", {} ) )
+ if info[0][1]:
+ inventory.append( ( "Open SSL Connections", {} ) )
+
+ return inventory
+
+def check_f5_bigip_conns(item, params, info):
+ if item == "Open Connections":
+ warn, crit = params.get("conns")
+ conns = int(info[0][0])
+ elif item == "Open SSL Connections":
+ warn, crit = params.get("sslconns")
+ conns = int(info[0][1])
+ else:
+ return 3, "no such item"
+
+ infotext = "Number %d (limits %d/%d)" % (conns, warn, crit)
+ perfdata = [ ("conns", conns, warn, crit ) ]
+ if conns > crit:
+ state = 2
+ elif conns > warn:
+ state = 1
+ else:
+ state = 0
+
+ return (state, infotext, perfdata)
+
+check_info["f5_bigip_conns"] = {
+ 'check_function' : check_f5_bigip_conns,
+ 'inventory_function' : inventory_f5_bigip_conns,
+ 'service_description' : 'Open Connections',
+ 'has_perfdata' : True,
+ 'default_levels_variable' : "f5_bigip_conns_default_levels",
+ 'snmp_info' : ( '.1.3.6.1.4.1.3375.2.1.1.2', [
+ '1.8', # sysStatServerCurConns
+ '9.2', # sysClientsslStatCurConns
+ ] ),
+ 'snmp_scan_function' : lambda oid: '.1.3.6.1.4.1.3375.2' in \
+ oid(".1.3.6.1.2.1.1.2.0") and "big-ip" in \
+ oid(".1.3.6.1.4.1.3375.2.1.4.1.0").lower(),
+}
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index 72898f8..06307eb 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -2661,6 +2661,35 @@ register_check_parameters(
register_check_parameters(
subgroup_applications,
+ "f5_connections",
+ _("F5 Loadbalancer Connections"),
+ Dictionary(
+ elements = [
+ ( "conns",
+ Tuple(
+ title = _("Max. number of connections"),
+ elements = [
+ Integer(title = _("Warning if above"), default_value =
25000 ),
+ Integer(title = _("Critical if above"), default_value =
30000 ) ,
+ ]
+ )
+ ),
+ ( "ssl_conns",
+ Tuple(
+ title = _("Max. number of ssl connections"),
+ elements = [
+ Integer(title = _("Warning if above"), default_value =
25000 ),
+ Integer(title = _("Critical if above"), default_value =
30000 ),
+ ]
+ )
+ ),
+ ]),
+ None,
+ "dict"
+)
+
+register_check_parameters(
+ subgroup_applications,
"dbsize",
_("Size of MySQL/PostgresQL databases"),
Optional(