Module: check_mk
Branch: master
Commit: f7e6a623dd18fb358335e5c03a1be1c28fa1b66b
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f7e6a623dd18fb…
Author: Konstantin Büttner <kb(a)mathias-kettner.de>
Date: Mon Jul 18 11:33:19 2016 +0200
3695 f5_bigip_cluster_v11: Now WATO configurable
How the config sync status is to be interpreted is now configurable.
Rediscovery required.
---
.werks/3695 | 10 +++++
ChangeLog | 2 +
checks/f5_bigip_cluster_v11 | 81 +++++++++++++++++++++-------------
web/plugins/wato/check_parameters.py | 23 ++++++++++
4 files changed, 85 insertions(+), 31 deletions(-)
diff --git a/.werks/3695 b/.werks/3695
new file mode 100644
index 0000000..aa43590
--- /dev/null
+++ b/.werks/3695
@@ -0,0 +1,10 @@
+Title: f5_bigip_cluster_v11: Now WATO configurable
+Level: 1
+Component: checks
+Compatible: incomp
+Version: 1.4.0i1
+Date: 1468834348
+Class: feature
+
+How the config sync status is to be interpreted is now configurable.
+Rediscovery required.
diff --git a/ChangeLog b/ChangeLog
index c35803a..219c4a7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -115,6 +115,8 @@
* 3706 hp_proliant_systeminfo, hp_proliant_mem, hp_proliant_da_phydrv: new inventory
plugins
* 3671 mssql_backup: Is now aware of backup types and outputs ages per backup type
* 3558 check_mail: now able to process mail body with Content-Transfer-Encoding
base64...
+ * 3695 f5_bigip_cluster_v11: Now WATO configurable...
+ NOTE: Please refer to the migration notes!
* 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_cluster_v11 b/checks/f5_bigip_cluster_v11
index 3b16a23..a44679d 100644
--- a/checks/f5_bigip_cluster_v11
+++ b/checks/f5_bigip_cluster_v11
@@ -34,45 +34,64 @@
# F5 nodes need to be ntp synced otherwise status reports might be wrong.
-f5_bigip_cluster_v11_states = {
- '0': ( "Unknown", 3),
- '1': ( "Syncing", 0),
- '2': ( "Need Manual Sync", 1),
- '3': ( "In Sync", 0),
- '4': ( "Sync Failed", 2),
- '5': ( "Sync Disconnected", 2),
- '6': ( "Standalone", 2),
- '7': ( "Awaiting Initial Sync", 1),
- '8': ( "Incompatible Version", 2),
- '9': ( "Partial Sync", 2),
+factory_settings["f5_bigip_cluster_v11"] = {
+ '0': 3,
+ '1': 0,
+ '2': 1,
+ '3': 0,
+ '4': 2,
+ '5': 2,
+ '6': 2,
+ '7': 1,
+ '8': 2,
+ '9': 2,
}
def inventory_f5_bigip_cluster_v11(info):
if len(info) == 1:
- return [(None, None)]
+ return [(None, {})]
-def check_f5_bigip_cluster_v11(_no_item, _no_params, info):
- statusid, statustxt = info[0]
- statename, state = f5_bigip_cluster_v11_states[statusid]
- infotext = statename
- if statename != statustxt:
- infotext += ' - ' + statustxt
- return state, infotext
+def check_f5_bigip_cluster_v11(_no_item, params, info):
+
+ status_names = {
+ '0': "Unknown",
+ '1': "Syncing",
+ '2': "Need Manual Sync",
+ '3': "In Sync",
+ '4': "Sync Failed",
+ '5': "Sync Disconnected",
+ '6': "Standalone",
+ '7': "Awaiting Initial Sync",
+ '8': "Incompatible Version",
+ '9': "Partial Sync",
+ }
+
+ status_id, status_txt = info[0]
+
+ status = params[status_id]
+ status_name = status_names[status_id]
+
+ infotext = status_name
+ if status_name != status_txt:
+ infotext += ' - ' + status_txt
+ return status, infotext
check_info["f5_bigip_cluster_v11"] = {
- 'check_function': check_f5_bigip_cluster_v11,
- 'inventory_function': inventory_f5_bigip_cluster_v11,
- 'service_description': 'Config Sync Status',
- 'snmp_info': ('.1.3.6.1.4.1.3375.2.1.14.1', [
- "1.0", # sysCmSyncStatusId
- "2.0" # sysCmSyncStatusStatus
- ]),
-
- '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() \
- and int(oid(".1.3.6.1.4.1.3375.2.1.4.2.0").split('.')[0]) >= 11,
+ 'default_levels_variable' : 'f5_bigip_cluster_v11',
+ 'check_function' : check_f5_bigip_cluster_v11,
+ 'inventory_function' : inventory_f5_bigip_cluster_v11,
+ 'service_description' : 'Config Sync Status',
+ 'snmp_info' : ('.1.3.6.1.4.1.3375.2.1.14.1', [
+ "1.0", # sysCmSyncStatusId
+ "2.0" # sysCmSyncStatusStatus
+ ]),
+
+ '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() \
+ and int(oid(".1.3.6.1.4.1.3375.2.1.4.2.0").split('.')[0])
>= 11,
+ 'group' : 'f5_bigip_cluster_v11',
}
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index d0d668a..5b848f2 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -212,6 +212,29 @@ register_check_parameters(
"first"
)
+register_check_parameters(
+ subgroup_networking,
+ "f5_bigip_cluster_v11",
+ _(u"Configuration Sync Status for F5 BigIP devices"),
+ Dictionary(
+ title = _("Interpretation of Config Sync Status"),
+ elements = [
+ ("0", MonitoringState(title = "Unknown", default_value =
3)),
+ ("1", MonitoringState(title = "Syncing", default_value =
0)),
+ ("2", MonitoringState(title = "Need Manual Sync",
default_value = 1)),
+ ("3", MonitoringState(title = "In Sync", default_value =
0)),
+ ("4", MonitoringState(title = "Sync Failed",
default_value = 2)),
+ ("5", MonitoringState(title = "Sync Disconnected",
default_value = 2)),
+ ("6", MonitoringState(title = "Standalone", default_value
= 2)),
+ ("7", MonitoringState(title = "Awaiting Initial Sync",
default_value = 1)),
+ ("8", MonitoringState(title = "Incompatible Version",
default_value = 2)),
+ ("9", MonitoringState(title = "Partial Sync",
default_value = 2)),
+ ]
+ ),
+ None,
+ "dict"
+)
+
#.
# .--Inventory-----------------------------------------------------------.
# | ___ _ |