Module: check_mk
Branch: master
Commit: 52112c930a4bd306698808c10e2e211ccec9a64e
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=52112c930a4bd3…
Author: Florian Kromer <fk(a)mathias-kettner.de>
Date: Wed Nov 7 10:12:40 2018 +0100
CMK-1238: configurable APC Symmetra battery state
Make state when battery needs to be replaced configurable.
Change-Id: I64c8e5f9fde2676114a88a4ff97277ca1c4a48a6
---
checks/apc_symmetra | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/checks/apc_symmetra b/checks/apc_symmetra
index 6a566d4..a598ac0 100644
--- a/checks/apc_symmetra
+++ b/checks/apc_symmetra
@@ -166,7 +166,8 @@ def check_apc_symmetra(_no_item, params, parsed):
if battery_replace:
state, state_readable = {
"1" : (0, "no battery needs replacing"),
- "2" : (params.get("battery_replace_state"), "battery
needs replacing"), }[battery_replace]
+ "2" : (params.get("battery_replace_state", 1),
"battery needs replacing"),
+ }.get(battery_replace, (3, "battery needs replacing: unknown"))
if battery_num_batt_packs and int(battery_num_batt_packs) > 1:
yield 2, "%i batteries need replacement" %
int(battery_num_batt_packs)
elif state: