Module: check_mk
Branch: master
Commit: c3b4146cdfed6960f029b4caa33377405e71ab18
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c3b4146cdfed69…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Thu Nov 7 10:12:00 2013 +0100
apc_symmetra: added the current output load in percent
---
checkman/apc_symmetra | 10 ++++++----
checks/apc_symmetra | 24 ++++++++++++++++++++++--
web/plugins/wato/check_parameters.py | 19 ++++++++++++++++++-
3 files changed, 46 insertions(+), 7 deletions(-)
diff --git a/checkman/apc_symmetra b/checkman/apc_symmetra
index 9ea8259..f3252f4 100644
--- a/checkman/apc_symmetra
+++ b/checkman/apc_symmetra
@@ -8,7 +8,8 @@ description:
{(2)} the output status, {(3)} the battery capacity, {(4)} the battery
temperature, {(5)} the battery current, {(6)} the output voltage and
{(7)} the output current, {(8)} the remaing run time. The output current and
- remaining run time are not checked against a level but are just displayed.
+ remaining run time are not checked against a level but are just displayed, {(9)} the
current
+ load in percent.
The check output includes the calibration status of the UPS. During a
calibration the check result in section {(2)} is OK even though the UPS is running
@@ -47,15 +48,16 @@ examples:
checkgroup_parameters['apc_symentra'] += [
# All UPS in production get other critical levels
( { "levels": (85, 35, 2, 210) }, ["prod"], ALL_HOSTS ),
+ ( { "output_load": (40, 50) }, ["power"], ALL_HOSTS ),
# All UPS get post calibration level of 50%
( { "post_calibration_levels": { "altcapacity": 50 } },
["prod"],ALL_HOSTS ),
( { "post_calibration_levels": { "additional_time_span": 60 } },
["prod"], ALL_HOSTS ),
]
perfdata:
- This check outputs five performance values: the battery capacity,
- the battery temperature, the battery current, the output voltage and
- the output current.
+ This check outputs six performance values: the battery capacity,
+ the battery temperature, the battery current, the output voltage,
+ the output current in percent and the output current.
inventory:
The inventory process checks if the device has a system description OIDs
(.1.3.6.1.2.1.1.2.0)
diff --git a/checks/apc_symmetra b/checks/apc_symmetra
index 2fa5e82..2ed3b97 100644
--- a/checks/apc_symmetra
+++ b/checks/apc_symmetra
@@ -65,6 +65,9 @@
# mm/dd/yy format."
# ::= { upsAdvTest 4 }
#
+# AdvOutputLoad 1.3.6.1.4.1.318.1.1.1.4.2.3.0
+# Returns The current UPS load expressed in percent of rated capacity.
+# Monitoring Condition Pass if less than 50
# old format:
# apc_default_levels = ( 95, 40, 1, 220 )
@@ -74,8 +77,8 @@ apc_default_levels = { "levels": ( 95, 40, 1, 220 ) }
def check_apc(item, params, info):
BasicBatteryStatus, BasicOutputStatus, AdvBatteryCapacity, \
AdvBatteryTemperature, AdvBatteryCurrent, AdvInputVoltage, AdvOutputVoltage, \
- AdvOutputCurrent, AdvBatteryRunTimeRemaining, AdvTestCalibrationResults \
- = [ saveint(x) for x in info[0][:10] ]
+ AdvOutputCurrent, AdvBatteryRunTimeRemaining, AdvTestCalibrationResults,
AdvOutputLoad \
+ = [ saveint(x) for x in info[0][:11] ]
LastDiagnosticsDate = info[0][-1]
RunTimeRemaining = AdvBatteryRunTimeRemaining / 100
@@ -179,6 +182,21 @@ def check_apc(item, params, info):
single_states.append( (0, "run time remaining: %02d:%02d:%02d" % (hrs,
mins, secs),
("runtime", RunTimeRemaining/60)) )
+ # 9. Adv Output load (load in percent)
+ load_state = 0
+ loadwarn, loadcrit = None, None
+ label = ""
+ if params.get('output_load'):
+ loadwarn, loadcrit = params['output_load']
+ if AdvOutputLoad >= loadcrit:
+ load_state = 2
+ label = "(!!)"
+ elif AdvOutputLoad >= loadwarn:
+ load_state = 1
+ label = "(!)"
+ single_states.append( ( load_state, "current output load %d%%%s" %
(AdvOutputLoad, label), \
+ ( "OutputLoad", AdvOutputLoad, loadwarn, loadcrit ) )
)
+
# create summary state
worst_state = max([x[0] for x in single_states])
info_text = ", ".join([x[1] for x in single_states])
@@ -209,6 +227,8 @@ check_info['apc_symmetra'] = {
"4.2.4.0", # AdvOutputCurrent,
"2.2.3.0", # AdvBatteryRunTimeRemaining,
"7.2.6.0", # AdvTestCalibrationResults
+ "4.2.3.0", # AdvOutputLoad
"7.2.4.0", # LastDiagnosticsDate
] )
}
+
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index c19e5e3..3bfa502 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -3400,6 +3400,23 @@ register_check_parameters(
),
]
)),
+ ("output_load",
+ Tuple(
+ title = _("Current Output Load"),
+ help = _("Indicates that the percentage load attached to the UPS
"
+ "This load affects the running time of all components being
supplied "
+ " with battery power."),
+ elements = [
+ Percentage(
+ title = _("Warning level"),
+ ),
+ Percentage(
+ title = _("Critical level"),
+ ),
+ ]
+
+ )
+ ),
("post_calibration_levels",
Dictionary(
title = _("Levels of battery parameters after calibration"),
@@ -3428,7 +3445,7 @@ register_check_parameters(
optional_keys = False,
)),
],
- optional_keys = ['post_calibration_levels'],
+ optional_keys = ['post_calibration_levels', 'output_load'],
),
None,
"first"