Module: check_mk
Branch: master
Commit: abefd6353d353e614f3e75647073c4443d72e202
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=abefd6353d353e…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Wed Aug 31 15:50:32 2016 +0200
3866 f5_bigip_cluster_failover: new check which monitors the cluster failover status of F5
BigIP devices
---
.werks/3866 | 9 +++++
ChangeLog | 1 +
checkman/f5_bigip_cluster_failover | 19 ++++++++++
checks/f5_bigip_cluster_failover | 67 ++++++++++++++++++++++++++++++++++
web/plugins/wato/check_parameters.py | 18 +++++++++
5 files changed, 114 insertions(+)
diff --git a/.werks/3866 b/.werks/3866
new file mode 100644
index 0000000..998adc3
--- /dev/null
+++ b/.werks/3866
@@ -0,0 +1,9 @@
+Title: f5_bigip_cluster_failover: new check which monitors the cluster failover status of
F5 BigIP devices
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.4.0i1
+Date: 1472651393
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index a5a001b..4db299d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -150,6 +150,7 @@
* 3797 Check_MK Check helpers: Decreased memory consumption in distributed setups...
* 3865 oracle_sessions: now relative levels for sessions are configurable...
* 3647 check_http: Improved rendering of the extended performance data
+ * 3866 f5_bigip_cluster_failover: new check which monitors the cluster failover
status of F5 BigIP devices
* 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_failover b/checkman/f5_bigip_cluster_failover
new file mode 100644
index 0000000..ba69fc6
--- /dev/null
+++ b/checkman/f5_bigip_cluster_failover
@@ -0,0 +1,19 @@
+title: F5 Big-IP: Cluster failover state
+agents: snmp
+catalog: hw/network/f5
+license: GPL
+distribution: check_mk
+description:
+ The check monitors the failover cluster state of F5 BIG-IP loadbalancers (local traffic
managers).
+ The default states are treated as follows:
+ unknown (0) is UNKNOWN,
+ offline (1) is CRIT,
+ forced offline (2) is CRIT,
+ standby (3) is OK,
+ active (4) is OK,
+
+ Moreover these levels are configurable.
+
+inventory:
+ One service is created.
+
diff --git a/checks/f5_bigip_cluster_failover b/checks/f5_bigip_cluster_failover
new file mode 100644
index 0000000..c38af9d
--- /dev/null
+++ b/checks/f5_bigip_cluster_failover
@@ -0,0 +1,67 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2016 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-
+# tails. 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.
+
+
+# .1.3.6.1.4.1.3375.2.1.14.1.4.0 --> F5-BIGIP-SYSTEM-MIB::sysCmFailoverStatusId
+# .1.3.6.1.4.1.3375.2.1.14.3.4.0 1/1 active -->
F5-BIGIP-SYSTEM-MIB::sysCmFailoverStatusDetails
+# See also
https://support.f5.com/kb/en-us/solutions/public/14000/300/sol14399.html
+
+
+def inventory_f5_bigip_cluster_failover(info):
+ if info:
+ return [ (None, {}) ]
+
+
+def check_f5_bigip_cluster_failover(_no_item, params, info):
+ map_states = {
+ "0" : (3, "unknown"),
+ "1" : (2, "offline"),
+ "2" : (2, "forced offline"),
+ "3" : (0, "standby"),
+ "4" : (0, "active"),
+ }
+
+ failover_state, details = info[0]
+ default_state, state_readable = map_states[failover_state]
+ if failover_state in params:
+ state = params[failover_state]
+ else:
+ state = default_state
+ return state, 'Status: %s, Details: %s' % (state_readable, details)
+
+
+check_info['f5_bigip_cluster_failover'] = {
+ 'inventory_function' : inventory_f5_bigip_cluster_failover,
+ 'check_function' : check_f5_bigip_cluster_failover,
+ 'service_description' : 'Cluster failover status',
+ 'snmp_info' : ('.1.3.6.1.4.1.3375.2.1.14.3', [
+ "1", #
F5-BIGIP-SYSTEM-MIB::sysCmFailoverStatusId
+ "4", #
F5-BIGIP-SYSTEM-MIB::sysCmFailoverStatusDetails
+ ]),
+ '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(),
+ 'group' : 'f5_bigip_cluster_failover_state',
+}
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index f6eae09..9407fd0 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -236,6 +236,24 @@ register_check_parameters(
)
register_check_parameters(
+ subgroup_networking,
+ "f5_bigip_cluster_failover_state",
+ _("Failover cluster state for F5 BigIP devices"),
+ Dictionary(
+ title = _("Interpretation of failover cluster state"),
+ elements = [
+ ("0", MonitoringState(title = "Unknown", default_value =
3)),
+ ("1", MonitoringState(title = "Offline", default_value =
2)),
+ ("2", MonitoringState(title = "Forced offline",
default_value = 2)),
+ ("3", MonitoringState(title = "Standby", default_value =
0)),
+ ("4", MonitoringState(title = "Active", default_value =
0)),
+ ]
+ ),
+ None,
+ "dict"
+)
+
+register_check_parameters(
subgroup_applications,
"f5_bigip_snat",
_("F5 Loadbalancer Source NAT"),