Module: check_mk
Branch: master
Commit: eb64a4de7fc45863972ad1aaa953f79dad3681ce
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=eb64a4de7fc458…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Mon Aug 29 11:08:34 2016 +0200
3794 f5_bigip_snat: now able to configure levels
---
.werks/3794 | 9 +++
ChangeLog | 1 +
checks/f5_bigip_snat | 27 +++++++-
web/plugins/wato/check_parameters.py | 114 ++++++++++++++++++++++++++++++++++
4 files changed, 149 insertions(+), 2 deletions(-)
diff --git a/.werks/3794 b/.werks/3794
new file mode 100644
index 0000000..10f2b6c
--- /dev/null
+++ b/.werks/3794
@@ -0,0 +1,9 @@
+Title: f5_bigip_snat: now able to configure levels
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.4.0i1
+Date: 1472461691
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index e3838d2..69eae53 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -143,6 +143,7 @@
NOTE: Please refer to the migration notes!
* 3863 didactum_sensors_analog, didactum_sensors_analog.voltage,
didactum_sensors_discrete: new checks which monitor the temperature, voltage and discrete
sensors of Didactum devices which support the DIDACTUM-SYSTEM-MIB
* 3793 f5_bigip_vserver: traffic and packet levels are now configurable
+ * 3794 f5_bigip_snat: now able to configure levels
* 3073 FIX: windows agent: relative paths to mrpe scripts are now treated as relative
to the agent installation directory...
* 3061 FIX: mk_jolokia: Fixed debugging of the agent plugin
* 3074 FIX: windows agent: fixed incorrect values for 32-bit performance counters
diff --git a/checks/f5_bigip_snat b/checks/f5_bigip_snat
index 64a8e66..5075aa7 100644
--- a/checks/f5_bigip_snat
+++ b/checks/f5_bigip_snat
@@ -39,9 +39,9 @@ def parse_f5_bigip_snat(info):
def inventory_f5_bigip_snat(parsed):
for name, snat in parsed.items():
- yield name, None
+ yield name, {}
-def check_f5_bigip_snat(item, _no_params, parsed):
+def check_f5_bigip_snat(item, params, parsed):
if item in parsed:
snat = parsed[item]
@@ -72,10 +72,33 @@ def check_f5_bigip_snat(item, _no_params, parsed):
# New connections per time
yield 0, "Rate: %.2f/sec" %
summed_values["connections_rate"]
+ # Check configured limits
+ map_paramvar_to_text = {
+ "if_in_octets": "Incoming Bytes",
+ "if_out_octets": "Outgoing Bytes",
+ "if_total_octets": "Total Bytes",
+ "if_in_pkts": "Incoming Packets",
+ "if_out_pkts": "Outgoing Packets",
+ "if_total_pkts": "Total Packets",
+ }
+ summed_values["if_total_octets"] =
summed_values["if_in_octets"] + summed_values["if_out_octets"]
+ summed_values["if_total_pkts"] =
summed_values["if_in_pkts"] + summed_values["if_out_pkts"]
+ for param_var, levels in params.items():
+ if param_var.endswith("_lower") and type(levels) == tuple:
+ levels = (None, None) + levels
+ value = summed_values[param_var.rstrip("_lower")]
+ state, extra_text, extra_perfdata = check_levels(value, param_var, levels)
+ if state:
+ if "octets" in param_var:
+ value = get_bytes_human_readable(value, base = 1000.0)
+ yield state, "%s: %s%s" %
(map_paramvar_to_text[param_var.rstrip("_lower")], value, extra_text)
+
+
check_info["f5_bigip_snat"] = {
"parse_function" : parse_f5_bigip_snat,
"check_function" : check_f5_bigip_snat,
"inventory_function" : inventory_f5_bigip_snat,
+ "group" : "f5_bigip_snat",
"service_description" : "Source NAT %s",
"has_perfdata" : True,
"snmp_info" : (".1.3.6.1.4.1.3375.2.2.9.2.3.1", [
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index 9468a78..efba29f 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -237,6 +237,120 @@ register_check_parameters(
register_check_parameters(
subgroup_applications,
+ "f5_bigip_snat",
+ _("F5 Loadbalancer Source NAT"),
+ Dictionary(
+ elements = [
+ ( "if_in_octets",
+ Levels(
+ title = _("Incoming Traffic Maximum"),
+ unit = _("bytes/s"),
+ default_difference = (5, 8),
+ default_value = None,
+ ),
+ ),
+ ( "if_in_octets_lower",
+ Levels(
+ title = _("Incoming Traffic Minimum"),
+ unit = _("bytes/s"),
+ default_difference = (5, 8),
+ default_value = None,
+ ),
+ ),
+ ( "if_out_octets",
+ Levels(
+ title = _("Outgoing Traffic Maximum"),
+ unit = _("bytes/s"),
+ default_difference = (5, 8),
+ default_value = None,
+ ),
+ ),
+ ( "if_out_octets_lower",
+ Levels(
+ title = _("Outgoing Traffic Minimum"),
+ unit = _("bytes/s"),
+ default_difference = (5, 8),
+ default_value = None,
+ ),
+ ),
+ ( "if_total_octets",
+ Levels(
+ title = _("Total Traffic Maximum"),
+ unit = _("bytes/s"),
+ default_difference = (5, 8),
+ default_value = None,
+ ),
+ ),
+ ( "if_total_octets_lower",
+ Levels(
+ title = _("Total Traffic Minimum"),
+ unit = _("bytes/s"),
+ default_difference = (5, 8),
+ default_value = None,
+ ),
+ ),
+
+
+ ( "if_in_pkts",
+ Levels(
+ title = _("Incoming Packets Maximum"),
+ unit = _("packets/s"),
+ default_difference = (5, 8),
+ default_value = None,
+ ),
+ ),
+ ( "if_in_pkts_lower",
+ Levels(
+ title = _("Incoming Packets Minimum"),
+ unit = _("packets/s"),
+ default_difference = (5, 8),
+ default_value = None,
+ ),
+ ),
+ ( "if_out_pkts",
+ Levels(
+ title = _("Outgoing Packets Maximum"),
+ unit = _("packets/s"),
+ default_difference = (5, 8),
+ default_value = None,
+ ),
+ ),
+ ( "if_out_pkts_lower",
+ Levels(
+ title = _("Outgoing Packets Minimum"),
+ unit = _("packets/s"),
+ default_difference = (5, 8),
+ default_value = None,
+ ),
+ ),
+ ( "if_total_pkts",
+ Levels(
+ title = _("Total Packets Maximum"),
+ unit = _("packets/s"),
+ default_difference = (5, 8),
+ default_value = None,
+ ),
+ ),
+ ( "if_total_pkts_lower",
+ Levels(
+ title = _("Total Packets Minimum"),
+ unit = _("packets/s"),
+ default_difference = (5, 8),
+ default_value = None,
+ ),
+ )
+ ]
+ ),
+ TextAscii(
+ title = _("Source NAT name"),
+ allow_empty = False
+ ),
+ 'dict'
+)
+
+
+register_check_parameters(
+ subgroup_applications,
"f5_bigip_vserver",
_("F5 Loadbalancer VServer"),
Dictionary(