apc_symmetra_output: some fixes
Message-ID: <58356aa5.nMzu/jdUzLNelIWy%si(a)mathias-kettner.de>
User-Agent: Heirloom mailx 12.5 6/20/10
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Module: check_mk
Branch: master
Commit: 8d9c190ed476901f2f0f694685e1f83ffad74179
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8d9c190ed47690…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Wed Nov 23 11:07:46 2016 +0100
4090 FIX apc_rackpdu_power, apc_symmetra, apc_symmetra_input, apc_symmetra_output: some
fixes
apc_rackpdu_power: fixed empty levels handling
apc_symmetra, apc_symmetra_input, apc_symmetra_output: fixed no data handling
---
.werks/4090 | 11 +++++++++++
ChangeLog | 1 +
checks/apc_rackpdu_power | 4 ++--
checks/apc_symmetra | 2 ++
checks/apc_symmetra_input | 2 ++
checks/apc_symmetra_output | 2 ++
6 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/.werks/4090 b/.werks/4090
new file mode 100644
index 0000000..5f64d1a
--- /dev/null
+++ b/.werks/4090
@@ -0,0 +1,11 @@
+Title: apc_rackpdu_power, apc_symmetra, apc_symmetra_input, apc_symmetra_output: some
fixes
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.4.0i3
+Date: 1479895471
+
+apc_rackpdu_power: fixed empty levels handling
+apc_symmetra, apc_symmetra_input, apc_symmetra_output: fixed no data handling
diff --git a/ChangeLog b/ChangeLog
index eac296b..4f6e55a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -19,6 +19,7 @@
* 4043 FIX: Add missing metric definition for 15 minute CPU load prediction'
* 3751 FIX: jolokia_metrics: Discovery no longer crashes in case of error querying
instance
* 4088 FIX: ntp: fixed incomplete data handling
+ * 4090 FIX: apc_rackpdu_power, apc_symmetra, apc_symmetra_input, apc_symmetra_output:
some fixes...
Multisite:
* 3974 FIX: Sorting comments in hover menu of comments icon by time now
diff --git a/checks/apc_rackpdu_power b/checks/apc_rackpdu_power
index 8eeb397..bfce1c7 100644
--- a/checks/apc_rackpdu_power
+++ b/checks/apc_rackpdu_power
@@ -37,9 +37,9 @@ def parse_apc_rackpdu_power(info):
for host, amperage_str, warn, crit in info:
amperage = float(amperage_str) / 10
- if amperage >= int(crit):
+ if crit != "" and amperage >= int(crit):
status_info = (amperage, (2, "crit exceeded"))
- elif amperage >= int(warn):
+ elif warn != "" and amperage >= int(warn):
status_info = (amperage, (1, "warn exceeded"))
else:
status_info = amperage
diff --git a/checks/apc_symmetra b/checks/apc_symmetra
index 1e63112..8c86b17 100644
--- a/checks/apc_symmetra
+++ b/checks/apc_symmetra
@@ -63,6 +63,8 @@
def parse_apc_symmetra(info):
parsed = {}
+ if not info:
+ return parsed
# some numeric fields may be empty
battery_status, output_status, state_output_state, battery_capacity,
\
diff --git a/checks/apc_symmetra_input b/checks/apc_symmetra_input
index 5fca28a..dd2ae9c 100644
--- a/checks/apc_symmetra_input
+++ b/checks/apc_symmetra_input
@@ -29,6 +29,8 @@
def parse_apc_symmetra_input(info):
+ if not info:
+ return {}
return { "Input" : { "voltage" : float(info[0][0]), }}
diff --git a/checks/apc_symmetra_output b/checks/apc_symmetra_output
index d7ca950..05a3e41 100644
--- a/checks/apc_symmetra_output
+++ b/checks/apc_symmetra_output
@@ -36,6 +36,8 @@ factory_settings["apc_symmetra_output_default_levels"] = {
def parse_apc_symmetra_output(info):
+ if not info:
+ return {}
voltage, current, load = map(float, info[0])
return { "Output" : {
"voltage" : voltage,