Module: check_mk
Branch: master
Commit: e795a9b03337e008c80eb91833c7299301e2de31
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e795a9b03337e0…
Author: Konstantin Büttner <kb(a)mathias-kettner.de>
Date: Tue Mar 28 14:51:10 2017 +0200
8630 FIX ups_bat_temp, ups_capacity, ups_in_freq, ups_in_voltage, ups_out_load, ups_out_voltage, ups_power, ups_test: Extend and unify range of discovered devices
Due to overly specific SNMP scan functions, discovery did not work properly for these checks
on some devices, or only for some of these checks, despite being based on the same MIB.
This has been fixed.
Change-Id: I3c2c072dcf3d83318d7dfdc45c9d80c52fb0ee41
---
.werks/8630 | 13 +++++++++++++
checks/ups_bat_temp | 14 +++-----------
checks/ups_capacity | 21 +++------------------
checks/ups_generic.include | 43 +++++++++++++++++++++++++++++++++++++++++++
checks/ups_in_freq | 7 ++-----
checks/ups_in_voltage | 8 ++------
checks/ups_out_load | 7 ++-----
checks/ups_out_voltage | 8 ++------
checks/ups_power | 6 ++----
checks/ups_test | 5 ++---
10 files changed, 74 insertions(+), 58 deletions(-)
Diff: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=e795a9b033…
Module: check_mk
Branch: master
Commit: 40583f6f0a10407b16d5c306f8a42bcfdccd357a
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=40583f6f0a1040…
Author: Marcel Arentz <ma(a)mathias-kettner.de>
Date: Wed Mar 15 16:37:43 2017 +0100
4540 emcvnx_disks: Thresholds for count of failures can be set now
Previously only the state for hard read or write failures could be set. As from
now additionally a counter of failures can be set. The Service will change the
state only if the amount of failure will be equal or higher than set in rule.
On default the Service will be go critical if there are 2 or more failures
detected.
Change-Id: Id71eee97c51c8f75ac29c04eff3573ec66c96bc0
---
.werks/4540 | 15 ++++++++++++++
checks/emcvnx_disks | 16 +++++++++++----
web/plugins/wato/check_parameters.py | 38 ++++++++++++++++++++++++++----------
3 files changed, 55 insertions(+), 14 deletions(-)
diff --git a/.werks/4540 b/.werks/4540
new file mode 100644
index 0000000..7cd0864
--- /dev/null
+++ b/.werks/4540
@@ -0,0 +1,15 @@
+Title: emcvnx_disks: Thresholds for count of failures can be set now
+Level: 1
+Component: checks
+Compatible: incomp
+Edition: cre
+Version: 1.5.0i1
+Date: 1489591974
+Class: feature
+
+Previously only the state for hard read or write failures could be set. As from
+now additionally a counter of failures can be set. The Service will change the
+state only if the amount of failure will be equal or higher than set in rule.
+
+On default the Service will be go critical if there are 2 or more failures
+detected.
diff --git a/checks/emcvnx_disks b/checks/emcvnx_disks
index c717bc3..0bb7c92 100644
--- a/checks/emcvnx_disks
+++ b/checks/emcvnx_disks
@@ -111,6 +111,13 @@
# 'state': 'Enabled'},
# }
+factory_settings['emcvnx_disks_default_levels'] = {
+ 'state_read_error' : (2, 2), # (state, count of errors)
+ 'state_write_error' : (2, 2), # (state, count of errors)
+ 'state_rebuilding' : 1,
+}
+
+
def parse_emcvnx_disks(info):
parsed = {}
for line in info:
@@ -162,14 +169,14 @@ def check_emcvnx_disks(item, params, parsed):
read_errors = parsed[item]["Hard Read Errors"]
message += ", Hard Read Errors: %s" % read_errors
- if read_errors > 0:
- nagstate = params.get("state_read_error", 2)
+ if read_errors >= params["state_read_error"][1]:
+ nagstate = params["state_read_error"][0]
message += " %s" % state_markers[nagstate]
write_errors = parsed[item]["Hard Write Errors"]
message += ", Hard Write Errors: %s" % write_errors
- if write_errors > 0:
- nagstate = params.get("state_write_error", 2)
+ if write_errors >= params["state_write_error"][1]:
+ nagstate = params["state_write_error"][0]
message += " %s" % state_markers[nagstate]
read_bytes = parsed[item]["Kbytes Read"] * 1024
@@ -195,4 +202,5 @@ check_info['emcvnx_disks'] = {
"service_description" : "Enclosure %s",
"group" : "emcvnx_disks",
"has_perfdata" : True,
+ "default_levels_variable" : "emcvnx_disks_default_levels"
}
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index bd08bf8..96d5b96 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -4349,22 +4349,40 @@ register_check_parameters(
Dictionary(
elements = [
("state_read_error",
- MonitoringState(
- default_value = 2,
- title = _("State on hard read error")
- )
+ Tuple(
+ title = _("State on hard read error"),
+ elements = [
+ MonitoringState(
+ title = _("State"),
+ default_value = 2,
+ ),
+ Integer(
+ title = _("Minimum error count"),
+ default_value = 2,
+ ),
+ ]
+ )
),
("state_write_error",
- MonitoringState(
- default_value = 2,
- title = _("State on hard write error")
- )
+ Tuple(
+ title = _("State on hard write error"),
+ elements = [
+ MonitoringState(
+ title = _("State"),
+ default_value = 2,
+ ),
+ Integer(
+ title = _("Minimum error count"),
+ default_value = 2,
+ ),
+ ]
+ )
),
("state_rebuilding",
- MonitoringState(
+ MonitoringState(
default_value = 1,
title = _("State when rebuildung enclosure")
- )
+ )
),
]
),