Module: check_mk
Branch: master
Commit: 1ce11c7702d2dd50260c350b846d396bf88df406
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1ce11c7702d2dd…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Nov 26 15:32:48 2014 +0100
#1551 f5_bigip_vserver: add performance data for connections and connection rate
---
.werks/1551 | 9 +++
ChangeLog | 1 +
checkman/f5_bigip_vserver | 8 ++-
checks/f5_bigip_vserver | 98 +++++++++++++++------------
pnp-templates/check_mk-f5_bigip_vserver.php | 41 +++++++++++
web/plugins/perfometer/check_mk.py | 6 ++
6 files changed, 117 insertions(+), 46 deletions(-)
diff --git a/.werks/1551 b/.werks/1551
new file mode 100644
index 0000000..9fd60f2
--- /dev/null
+++ b/.werks/1551
@@ -0,0 +1,9 @@
+Title: f5_bigip_vserver: add performance data for connections and connection rate
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.5i7
+Date: 1417012351
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 815d18e..bc01d24 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -24,6 +24,7 @@
* 1509 if, if64: New option for make inventory based on port alias...
* 1440 livedump: now able to add hosts icon_image on config generation...
* 1517 carel_sensors: New check for monitoring temperature sensors of Carel AC
devices
+ * 1551 f5_bigip_vserver: add performance data for connections and connection rate
* 1478 FIX: kernel.util, statgrab_cpu: fix computation of utilization...
* 1480 FIX: brocade_vdx_status: disable check on some devices that do not support
it...
* 1485 FIX: dell_om_disks, dell_om_esmlog, dell_om_mem, dell_om_processors,
dell_om_sensors: detect more devices...
diff --git a/checkman/f5_bigip_vserver b/checkman/f5_bigip_vserver
index 5e2b7e2..bd9f9d8 100644
--- a/checkman/f5_bigip_vserver
+++ b/checkman/f5_bigip_vserver
@@ -4,11 +4,17 @@ catalog: hw/network/f5
license: GPL
distribution: check_mk
description:
- The check queries the MIB tables of F5 BIG-IP loadbalancers (local traffic
+ The check queries the MIB tables of F5 BIG-IP load balancers (local traffic
managers) for the status of any virtual server defined on them. It supports
devices running the 9.0 and above releases of the F5 OS. It's tested against
9.3 devices.
+ Also the number of current client connections and the current connection
+ rate are being displayed:
+
+perfdata:
+ two values: the current number of connections and the current connection rate.
+
inventory:
Any virtual server that is found online will be added during inventoryy
and checked for it's status. Virtual servers in the various "Warning"
diff --git a/checks/f5_bigip_vserver b/checks/f5_bigip_vserver
index a2b1d24..a1ca258 100644
--- a/checks/f5_bigip_vserver
+++ b/checks/f5_bigip_vserver
@@ -25,55 +25,63 @@
# Boston, MA 02110-1301 USA.
-# Example output
-# Name of a Virt. Server:
-# 1.3.6.1.4.1.3375.2.2.10.2.3.1.1.ascii_encoded_string. "VS_XX"
-# Textual Status (only supported in F5 OS 9.3+
-# 1.3.6.1.4.1.3375.2.2.10.1.2.1.25.5.12.34.56.78.90 "The virtual server is
available"
-# Table with name and status
-# 1.3.6.1.4.1.3375.2.2.10.13.2.1. 1 .5.12.34.56.78.90 "VS_XX"
-# 1.3.6.1.4.1.3375.2.2.10.13.2.1. 2 .5.12.34.56.78.90 1
+def parse_f5_bigip_vserver(info):
+ vservers = {}
+ for name, status, tot_conns, cur_conns in info:
+ vservers[name] = {
+ "status" : int(status),
+ "tot_conns" : int(tot_conns),
+ "cur_conns" : int(cur_conns),
+ }
+ return vservers
-def inventory_f5_bigip_vserver(checkname,info):
- inventory = []
- for line in info:
-# snmp info will return some empty lines here, filter them and
-# only inventorize OK status.
- if line[0] != "":
- if int(line[1]) == 1:
- inventory.append((line[0], None))
- return inventory
+def inventory_f5_bigip_vserver(parsed):
+ for name, vserver in parsed.items():
+ if vserver["status"] == 1:
+ yield name, None
-def check_f5_bigip_vserver(item, _no_params, info):
- for line in info:
- if line[0] != "":
- if line[0] == item:
- status = int(line[1])
- if status == 0:
- return (1, "Virtual Server is disabled")
- elif status == 1:
- return (0, "Virtual Server is up and available")
- elif status == 2:
- return (2, "Virtual Server is currently not available")
- elif status == 3:
- return (2, "Virtual Server is not available")
- elif status == 4:
- return (1, "Virtual Server status is unknown")
- else:
- return (3, "Unhandled status (%d)" % status)
- return (3, "Virtual Server %s not found in SNMP output" % item)
+def check_f5_bigip_vserver(item, _no_params, parsed):
+ if item in parsed:
+ vserver = parsed[item]
+
+ # Current number of connections
+ yield 0, "Client connections: %d" % vserver["cur_conns"],
[("connections", vserver["cur_conns"])]
+
+ # New connections per time
+ counter_name = "f5_bigip_vserver.%s.connections" % item
+ timedif, rate = get_counter(counter_name, time.time(),
vserver["tot_conns"])
+ yield 0, "Rate: %.2f/sec" % rate, [("conn_rate", rate)]
+
+ # Current server status
+ status = vserver["status"]
+ if status == 0:
+ yield 1, "Virtual Server is disabled"
+ elif status == 1:
+ yield 0, "Virtual Server is up and available"
+ elif status == 2:
+ yield 2, "Virtual Server is currently not available"
+ elif status == 3:
+ yield 2, "Virtual Server is not available"
+ elif status == 4:
+ yield 1, "Virtual Server status is unknown"
+ else:
+ yield 3, "Unhandled status (%d)" % status
+
check_info["f5_bigip_vserver"] = {
- 'check_function': check_f5_bigip_vserver,
- 'inventory_function': inventory_f5_bigip_vserver,
- 'service_description': 'Virtual Server %s',
- 'snmp_info': ('.1.3.6.1.4.1.3375.2.2.10.13.2.1', [
- 1, # Name
- 2, # Status
- ]),
- '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(),
+ 'parse_function' : parse_f5_bigip_vserver,
+ 'check_function' : check_f5_bigip_vserver,
+ 'inventory_function' : inventory_f5_bigip_vserver,
+ 'service_description' : 'Virtual Server %s',
+ "has_perfdata" : True,
+ 'snmp_info' : ('.1.3.6.1.4.1.3375.2.2.10', [
+ "13.2.1.1", # Name
+ "13.2.1.2", # Status
+ "2.3.1.11", #
ltmVirtualServStatClientTotConns
+ "2.3.1.12", #
ltmVirtualServStatClientCurConns
+ ]),
+ '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/pnp-templates/check_mk-f5_bigip_vserver.php
b/pnp-templates/check_mk-f5_bigip_vserver.php
new file mode 100644
index 0000000..ca37a63
--- /dev/null
+++ b/pnp-templates/check_mk-f5_bigip_vserver.php
@@ -0,0 +1,41 @@
+<?php
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2014 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 'Client Connections' -l0 --title
\"$servicedesc - Connections\" ";
+
+$def[1] = "DEF:conns=$RRDFILE[1]:$DS[1]:MAX ";
+$def[1] .= "AREA:conns#4060a0:\"Current Client Connections\" ";
+$def[1] .= "LINE:conns#203060 ";
+$def[1] .= "GPRINT:conns:LAST:\"%7.0lf %s LAST\" ";
+$def[1] .= "GPRINT:conns:MAX:\"%7.0lf %s MAX\\n\" ";
+
+$opt[2] = "--vertical-label 'Connects/sec' -l0 --title \"$servicedesc -
Connects\" ";
+
+$def[2] = "DEF:conns=$RRDFILE[2]:$DS[2]:MAX ";
+$def[2] .= "AREA:conns#80a0f0:\"Connects/sec\" ";
+$def[2] .= "LINE:conns#4060a0 ";
+$def[2] .= "GPRINT:conns:LAST:\"%7.0lf %s LAST\" ";
+$def[2] .= "GPRINT:conns:MAX:\"%7.0lf %s MAX\\n\" ";
+?>
diff --git a/web/plugins/perfometer/check_mk.py b/web/plugins/perfometer/check_mk.py
index 87f6fa9..b4a6ae3 100644
--- a/web/plugins/perfometer/check_mk.py
+++ b/web/plugins/perfometer/check_mk.py
@@ -1198,3 +1198,9 @@ def perfometer_ups_outphase(row, check_command, perf_data):
return "%d%%" % load, perfometer_linear(load, "#8050ff")
perfometers["check_mk-ups_socomec_outphase"] = perfometer_ups_outphase
+
+def perfometer_f5_bigip_vserver(row, check_command, perf_data):
+ connections = int(perf_data[0][1])
+ return str(connections), perfometer_logarithmic(connections, 100, 2,
"#46a")
+
+perfometers["check_mk-f5_bigip_vserver"] = perfometer_f5_bigip_vserver