Module: check_mk
Branch: master
Commit: 11a0371010695582a60f6eee79fb9742cadd6308
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=11a03710106955…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Mon Feb 27 10:05:39 2017 +0100
4447 f5_bigip_conns: Now also monitors the connection rate per seconds
This check now also determines the rate for the sum of sysClientSslStatTotCompatConns and
sysClientSslStatTotNativeConns.
Change-Id: I18cdc4f9381664366d062c6a8d2ae385a81d7850
---
.werks/4447 | 12 +++++++++
checkman/f5_bigip_conns | 3 ++-
checks/f5_bigip_conns | 48 ++++++++++++++++++++++++++----------
web/plugins/wato/check_parameters.py | 14 +++++++++++
4 files changed, 63 insertions(+), 14 deletions(-)
diff --git a/.werks/4447 b/.werks/4447
new file mode 100644
index 0000000..b0b5b41
--- /dev/null
+++ b/.werks/4447
@@ -0,0 +1,12 @@
+Title: f5_bigip_conns: Now also monitors the connection rate per seconds
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.5.0i1
+Date: 1488186222
+Class: feature
+
+This check now also determines the rate for the sum of sysClientSslStatTotCompatConns and
sysClientSslStatTotNativeConns.
+
+
diff --git a/checkman/f5_bigip_conns b/checkman/f5_bigip_conns
index ad1775f..0218181 100644
--- a/checkman/f5_bigip_conns
+++ b/checkman/f5_bigip_conns
@@ -6,7 +6,8 @@ distribution: check_mk
description:
The check queries the MIB tables of F5 BIG-IP loadbalancers (local traffic managers)
for the number of current connections {sysStatClientCurConns} and the number of current
- ssl connections {sysClientsslStatCurConns}.
+ ssl connections {sysClientsslStatCurConns} as well as the cumulative connection rate
+ of {sysClientSslStatTotNativeConns} and {sysClientSslStatTotCompatConns}.
Warning and critical limits can be given for both types of data.
It supports devices running the 9.0 and above releases of the F5 OS. It's tested
against 9.3
diff --git a/checks/f5_bigip_conns b/checks/f5_bigip_conns
index a384912..2bc4054 100644
--- a/checks/f5_bigip_conns
+++ b/checks/f5_bigip_conns
@@ -25,13 +25,9 @@
# Boston, MA 02110-1301 USA.
-# .1.3.6.1.4.1.3375.2.1.1.2.1.8.0 594 -->
F5-BIGIP-SYSTEM-MIB::sysStatClientCurConns.0
-# .1.3.6.1.4.1.3375.2.1.1.2.9.2.0 --> F5-BIGIP-SYSTEM-MIB::sysClientsslStatCurConns.0
-
-
factory_settings["f5_bigip_conns_default_levels"] = {
- "conns" : (25000, 30000),
- "ssl_conns" : (25000, 30000),
+ "conns" : (25000, 30000),
+ "ssl_conns" : (25000, 30000),
}
@@ -41,23 +37,46 @@ def inventory_f5_bigip_conns(info):
def check_f5_bigip_conns(item, params, info):
- for val, what, perfkey, title in [
- (info[0][0], "conns", "connections",
"Connections"),
- (info[0][1], "ssl_conns", "connections_ssl", "SSL
connections")]:
+ # Connection rate
+ now = time.time()
+ total_native_compat_rate = 0
+ conns_dict = {}
+
+ for line in info:
+ native_conn_rate = get_rate("native", now, int(line[2]))
+ compat_conn_rate = get_rate("compat", now, int(line[3]))
+ total_native_compat_rate += native_conn_rate + compat_conn_rate
+
+ if line[0] != "":
+ conns_dict.setdefault("total", 0)
+ conns_dict["total"] += int(line[0])
+
+ if line[1] != "":
+ conns_dict.setdefault("total_ssl", 0)
+ conns_dict["total_ssl"] += int(line[1])
+
+ conn_rate_params = params.get("connections_rate") or (None, None)
+ conn_rate_params += params.get("connections_rate_lower") or (None, None)
+
+ # Current connections
+ for val, dsname, params_values, perfkey, title in [
+ (conns_dict.get("total", None), "conns",
params.get("conns"), "connections",
"Connections"),
+ (conns_dict.get("total_ssl", None), "ssl_conns",
params.get("ssl_conns"), "connections_ssl", "SSL
connections"),
+ (total_native_compat_rate, "connections_rate", conn_rate_params,
"connections_rate", "Connections/s")
+ ]:
state = 0
infotext = "%s:" % title
perfdata = []
# SSL may not be configured, eg. on test servers
- if val == "":
+ if val == None:
infotext += " not configured"
-
else:
- warn, crit = params.get(what)
+ warn, crit = params_values[:2]
perfdata.append((perfkey, val, warn, crit))
- state, extrainfo, extraperf = check_levels(int(val), what, params.get(what))
+ state, extrainfo, extraperf = check_levels(val, dsname, params_values)
infotext += " %s%s" % (val, extrainfo)
if len(extraperf) > 0:
@@ -66,6 +85,7 @@ def check_f5_bigip_conns(item, params, info):
yield state, infotext, perfdata
+
check_info["f5_bigip_conns"] = {
'check_function' : check_f5_bigip_conns,
'inventory_function' : inventory_f5_bigip_conns,
@@ -73,6 +93,8 @@ check_info["f5_bigip_conns"] = {
'snmp_info' : ( '.1.3.6.1.4.1.3375.2.1.1.2', [
'1.8', #
F5-BIGIP-SYSTEM-MIB::sysStatClientCurConns
'9.2', #
F5-BIGIP-SYSTEM-MIB::sysClientsslStatCurConns
+ '9.6', #
F5-BIGIP-SYSTEM-MIB::sysClientSslStatTotNativeConns
+ '9.9', #
F5-BIGIP-SYSTEM-MIB::sysClientSslStatTotCompatConns
]),
'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 \
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index 9671271..a42d706 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -9212,6 +9212,7 @@ register_check_parameters(
"dict"
)
+
register_check_parameters(
subgroup_applications,
"f5_connections",
@@ -9232,6 +9233,19 @@ register_check_parameters(
default_levels = (25000, 30000)
)
),
+ ( "connections_rate",
+ Levels(
+ title = _("Maximum connections per second"),
+ default_value = None,
+ default_levels = (500, 1000)
+ )
+ ),
+ ( "connections_rate_lower",
+ Levels(
+ title = _("Minimum connections per second"),
+ default_value = None,
+ )
+ ),
]),
None,
"dict"