Module: check_mk
Branch: master
Commit: d61094eb01fdd3350a9307c4040bb2663f7d471d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d61094eb01fdd3…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Tue Aug 23 17:02:04 2016 +0200
3790 f5_bigip_cluster_status: New check to monitor integrity of active/active and
standby/active clusters
---
.werks/3790 | 9 ++++
ChangeLog | 1 +
checkman/f5_bigip_cluster_status | 17 ++++++
checks/f5_bigip_cluster_status | 99 ++++++++++++++++++++++++++++++++++
web/plugins/wato/check_parameters.py | 25 +++++++++
5 files changed, 151 insertions(+)
diff --git a/.werks/3790 b/.werks/3790
new file mode 100644
index 0000000..29642ef
--- /dev/null
+++ b/.werks/3790
@@ -0,0 +1,9 @@
+Title: f5_bigip_cluster_status: New check to monitor integrity of active/active and
standby/active clusters
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.4.0i1
+Date: 1471964487
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index e734b4a..0e597b4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -135,6 +135,7 @@
* 3778 if: now levels for discards rate are configurable
* 3788 f5_big_pool: check is now cluster ready
* 3789 f5_bigip_snat: new check for source NAT monitoring
+ * 3790 f5_bigip_cluster_status: New check to monitor integrity of active/active and
standby/active clusters
* 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/checkman/f5_bigip_cluster_status b/checkman/f5_bigip_cluster_status
new file mode 100644
index 0000000..8b0eb21
--- /dev/null
+++ b/checkman/f5_bigip_cluster_status
@@ -0,0 +1,17 @@
+title: F5 Big-IP: active/active or passive/active cluster status
+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) to
identify
+ if the cluster correctly runs in an {active/active} or an {active/passive} setup.
+ You can configure the expected behaviour via a WATO rule.
+ It will issue a warning if the cluster setup differs from the expected setup.
+ This check is expected to be run on cluster hosts, since it evaluates the state of
multiple nodes.
+ If you run this check on a cluster node, it will raise no warning if the cluster node
state
+ differs from {active}.
+
+inventory:
+ Creates on service
+
diff --git a/checks/f5_bigip_cluster_status b/checks/f5_bigip_cluster_status
new file mode 100644
index 0000000..9366531
--- /dev/null
+++ b/checks/f5_bigip_cluster_status
@@ -0,0 +1,99 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Dennis Lerch dennis.lerch(a)telekom.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.
+
+#SNMPv2-SMI::enterprises.3375.2.1.1.1.1.19.0 = INTEGER: 0 #Version < 11.2
+#SNMPv2-SMI::enterprises.3375.2.1.14.3.1.0 = INTEGER: 3 #Version >= 11.2
+
+factory_settings["f5_bigip_cluster_default_levels"] = {
+ "type" : "active_standby",
+}
+
+def parse_f5_bigip_cluster_status(info):
+ cluster_status = {}
+ for status in info:
+ cluster_status[status[0]] = int(status[1])
+ return cluster_status
+
+def inventory_f5_bigip_cluster_status(parsed):
+ if parsed:
+ return [ ( None, None ) ]
+
+def check_f5_bigip_cluster_status(_no_item, params, parsed, is_v11_2 = False):
+ if is_v11_2:
+ node_state = ["unknown", "offline",
"forcedOffline", "standby", "active"]
+ active_value = 4
+ else:
+ node_state = ["standby", "active 1", "active 2",
"active"]
+ active_value = 3
+
+ if params["type"] == "active_standby" and
parsed.values().count(active_value) > 1:
+ yield 2, "More than 1 node is active: "
+ elif active_value not in parsed.values() and len(parsed) > 1: # Only applies if
this check runs on a cluster
+ yield 2, "No active node found: "
+
+ for node in sorted(parsed):
+ node_name = node and "[%s] " % node or ""
+ yield 0, "Node %sis %s" % (node_name, node_state[parsed[node]])
+
+def scan_f5_bigip_cluster_status(oid, is_v11_2 = False):
+ if not (".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()):
+ return False
+
+ version = oid(".1.3.6.1.4.1.3375.2.1.4.2.0")
+ if not version:
+ return False
+
+ expected_version = 11.2
+ version_float = float(".".join(version.split(".")[:2]))
+ return (version_float >= expected_version) == is_v11_2
+
+
+check_info["f5_bigip_cluster_status"] = {
+ "parse_function" : parse_f5_bigip_cluster_status,
+ "check_function" : lambda x,y,z:
check_f5_bigip_cluster_status(x,y,z, is_v11_2 = False),
+ "inventory_function" : inventory_f5_bigip_cluster_status,
+ "node_info" : True,
+ "group" : "cluster_status",
+ "default_levels_variable" : "f5_bigip_cluster_default_levels",
+ "service_description" : "BIG-IP Cluster Status",
+ "snmp_info" : (".1.3.6.1.4.1.3375.2.1.1.1.1.19",
["0"]), # sysAttrFailoverUnitMask
+ "snmp_scan_function" : lambda oid: scan_f5_bigip_cluster_status(oid,
is_v11_2 = False)
+}
+
+check_info["f5_bigip_cluster_status_v11_2"] = {
+ "parse_function" : parse_f5_bigip_cluster_status,
+ "check_function" : lambda x,y,z:
check_f5_bigip_cluster_status(x,y,z, is_v11_2 = True),
+ "inventory_function" : inventory_f5_bigip_cluster_status,
+ "node_info" : True,
+ "group" : "cluster_status",
+ "default_levels_variable" : "f5_bigip_cluster_default_levels",
+ "service_description" : "BIG-IP Cluster Status",
+ "snmp_info" : (".1.3.6.1.4.1.3375.2.1.14.3.1",
["0"]), # sysCmFailoverStatusId
+ "snmp_scan_function" : lambda oid: scan_f5_bigip_cluster_status(oid,
is_v11_2 = True)
+}
+
+
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index 9960ff6..ad297ff 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -235,6 +235,31 @@ register_check_parameters(
"dict"
)
+register_check_parameters(
+ subgroup_applications,
+ "cluster_status",
+ _("Cluster status"),
+ Dictionary(
+ elements = [
+ ("type",
+ DropdownChoice(
+ title = _("Cluster type"),
+ help = _("Expected cluster type."),
+ choices = [
+ ( "active_standby" , _("active / standby")
),
+ ( "active_active" , _("active / active") ),
+ ],
+ default_value = "active_standby"
+ )
+ ),
+ ],
+ required_keys = ["type"]
+ ),
+ None,
+ "dict"
+)
+
+
#.
# .--Inventory-----------------------------------------------------------.
# | ___ _ |