Module: check_mk
Branch: master
Commit: 2fea626bbdb35b50e54fa75460e65d7d2520797c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2fea626bbdb35b…
Author: Óscar Nájera <on(a)mathias-kettner.de>
Date: Mon Oct 8 16:53:19 2018 +0200
6644 UPS output load WATO rules
UPS output load includes default levels for warn and crit levels. This
threshold levels are now configurable in WATO
Change-Id: I3df9b5543f41746320530d9459b2f698e44284f8
---
.werks/6644 | 11 +++++++++++
checks/ups_out_load | 26 ++++++++++++++------------
cmk/gui/plugins/wato/check_parameters.py | 16 ++++++++++++++++
3 files changed, 41 insertions(+), 12 deletions(-)
diff --git a/.werks/6644 b/.werks/6644
new file mode 100644
index 0000000..d872a41
--- /dev/null
+++ b/.werks/6644
@@ -0,0 +1,11 @@
+Title: UPS output load WATO rules
+Level: 1
+Component: wato
+Compatible: compat
+Edition: cre
+Version: 1.6.0i1
+Date: 1539010234
+Class: feature
+
+UPS output load includes default levels for warn and crit levels. This
+threshold levels are now configurable in WATO
diff --git a/checks/ups_out_load b/checks/ups_out_load
index 2289530..75aba5e 100644
--- a/checks/ups_out_load
+++ b/checks/ups_out_load
@@ -24,21 +24,21 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
+ups_out_load_default_levels = (85, 90) # warning / critical
-ups_out_load_default_levels = (85, 90) # warning / critical
def inventory_ups_out_load(info):
if len(info) > 0:
- return [ ( x[0], "ups_out_load_default_levels") for x in info if
int(x[1]) > 0]
+ return [(x[0], "ups_out_load_default_levels") for x in info if
int(x[1]) > 0]
+
def check_ups_out_load(item, params, info):
warn, crit = params
for line in info:
if line[0] == item:
power = int(line[1])
- perfdata = [ ( "out_load", power, warn, crit, 100 ) ]
- infotext = "load: %d (warn/crit at %d/%d) " % \
- (power, warn, crit)
+ perfdata = [("out_load", power, warn, crit, 100)]
+ infotext = "load: %d (warn/crit at %d/%d) " % (power, warn, crit)
if power >= crit:
return (2, infotext, perfdata)
@@ -48,12 +48,14 @@ def check_ups_out_load(item, params, info):
return (3, "Phase %s not found in SNMP output" % item)
+
check_info['ups_out_load'] = {
- "inventory_function" : inventory_ups_out_load,
- "check_function" : check_ups_out_load,
- "service_description" : "OUT load phase %s",
- "has_perfdata" : True,
- "snmp_info" : ( ".1.3.6.1.2.1.33.1.4.4.1", [ 0, 5 ] ),
- "snmp_scan_function" : ups_generic_scan_function,
- "includes" : [ "ups_generic.include" ],
+ "inventory_function": inventory_ups_out_load,
+ "check_function": check_ups_out_load,
+ "service_description": "OUT load phase %s",
+ "has_perfdata": True,
+ "snmp_info": (".1.3.6.1.2.1.33.1.4.4.1", [0, 5]),
+ "snmp_scan_function": ups_generic_scan_function,
+ "group": "ups_out_load",
+ "includes": ["ups_generic.include"],
}
diff --git a/cmk/gui/plugins/wato/check_parameters.py
b/cmk/gui/plugins/wato/check_parameters.py
index db4bc0d..9f94be3 100644
--- a/cmk/gui/plugins/wato/check_parameters.py
+++ b/cmk/gui/plugins/wato/check_parameters.py
@@ -13890,6 +13890,22 @@ register_check_parameters(
register_check_parameters(
subgroup_environment,
+ "ups_out_load",
+ _("Parameters for output loads of UPSs and PDUs"),
+ Tuple(
+ elements = [
+ Integer(title = _("warning at"), unit = u"%",
default_value = 85),
+ Integer(title = _("critical at"), unit = u"%",
default_value = 90),
+ ]
+ ),
+ TextAscii(
+ title = _("Phase"),
+ help = _("The identifier of the phase the power is related to.")),
+ "first"
+)
+
+register_check_parameters(
+ subgroup_environment,
"epower_single",
_("Electrical Power for Devices with only one phase"),
Tuple(