Module: check_mk
Branch: master
Commit: d7fe58298bec139a0b91c8d9c569201247a866a1
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d7fe58298bec13…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Fri Sep 2 11:04:05 2016 +0200
3868 f5_bigip_cluster_status: node states are configurable for F5 BigIP devices since
version 11.2
---
.werks/3868 | 9 ++++++
ChangeLog | 1 +
checkman/f5_bigip_cluster_status | 4 +++
checks/f5_bigip_cluster_status | 58 ++++++++++++++++++++--------------
web/plugins/wato/check_parameters.py | 13 ++++++++
5 files changed, 62 insertions(+), 23 deletions(-)
diff --git a/.werks/3868 b/.werks/3868
new file mode 100644
index 0000000..e2c769e
--- /dev/null
+++ b/.werks/3868
@@ -0,0 +1,9 @@
+Title: f5_bigip_cluster_status: node states are configurable for F5 BigIP devices since
version 11.2
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.4.0i1
+Date: 1472807033
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 80f23c9..1d2b03e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -152,6 +152,7 @@
* 3865 oracle_sessions: now relative levels for sessions are configurable...
* 3647 check_http: Improved rendering of the extended performance data
* 3867 filter 'Servicegroup (Regex)' can be negated
+ * 3868 f5_bigip_cluster_status: node states are configurable for F5 BigIP devices
since version 11.2
* 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
index 8b0eb21..6dd8ee9 100644
--- a/checkman/f5_bigip_cluster_status
+++ b/checkman/f5_bigip_cluster_status
@@ -12,6 +12,10 @@ description:
If you run this check on a cluster node, it will raise no warning if the cluster node
state
differs from {active}.
+ Since version 11.2 you are able to configure the node states. Default values are:
+ unknown will be treated as UNKNOWN, offline as CRIT, forced offline as CRIT,
+ standby as OK and active as OK.
+
inventory:
Creates on service
diff --git a/checks/f5_bigip_cluster_status b/checks/f5_bigip_cluster_status
index 9366531..1d7d83f 100644
--- a/checks/f5_bigip_cluster_status
+++ b/checks/f5_bigip_cluster_status
@@ -24,29 +24,48 @@
# 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 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
+
+
def parse_f5_bigip_cluster_status(info):
- cluster_status = {}
- for status in info:
- cluster_status[status[0]] = int(status[1])
- return cluster_status
+ parsed = {}
+ for node, status in info:
+ parsed[node] = status
+ return parsed
+
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"]
+ node_states = ["unknown", "offline", "forced
offline", "standby", "active"]
active_value = 4
else:
- node_state = ["standby", "active 1", "active 2",
"active"]
+ node_states = ["standby", "active 1", "active 2",
"active"]
active_value = 3
if params["type"] == "active_standby" and
parsed.values().count(active_value) > 1:
@@ -55,21 +74,15 @@ def check_f5_bigip_cluster_status(_no_item, params, parsed, is_v11_2 =
False):
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
+ node_name = node and "[%s] " % node or ""
+ node_state = parsed[node]
+ state = 0
+ if is_v11_2:
+ if node_state in params.get("v11_2_states", []):
+ state = params["v11_2_states"][node_state]
+ else:
+ state = { "0" : 3, "1" : 2, "2" : 2,
"3" : 0, "4" : 0, }[node_state]
+ yield state, "Node %sis %s" % (node_name,
node_states[int(node_state)])
check_info["f5_bigip_cluster_status"] = {
@@ -84,6 +97,7 @@ check_info["f5_bigip_cluster_status"] = {
"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),
@@ -95,5 +109,3 @@ check_info["f5_bigip_cluster_status_v11_2"] = {
"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 e5042b1..de571f1 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -480,6 +480,19 @@ register_check_parameters(
default_value = "active_standby"
)
),
+ ("v11_2_states",
+ Dictionary(
+ title = _("Interpretation of failover cluster state"),
+ help = _("Here you can set the failover state for BIG-IP system
of version 11.2.0"),
+ 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)),
+ ]
+ )
+ )
],
required_keys = ["type"]
),