Module: check_mk
Branch: master
Commit: 7f701782a82d15b92fa5bda6339b91e36c615501
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7f701782a82d15…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Thu Nov 12 18:11:53 2015 +0100
#2836 FIX pandacom_psu: fixed handling of not available power supplies
---
.werks/2836 | 9 +++++++++
ChangeLog | 1 +
checks/pandacom_psu | 11 ++++++-----
3 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/.werks/2836 b/.werks/2836
new file mode 100644
index 0000000..85a5bca
--- /dev/null
+++ b/.werks/2836
@@ -0,0 +1,9 @@
+Title: pandacom_psu: fixed handling of not available power supplies
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i4
+Date: 1447348259
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index 4948e93..0bd89d1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -77,6 +77,7 @@
* 2775 FIX: omd_status: handle case where status information is incomplete due to
missing cmk version
* 2835 FIX: netextreme_psu_in: fixed wrong voltage usage handling...
* 2776 FIX: apache_status: fix crash for Apache versions with yet unhandled status
fields
+ * 2836 FIX: pandacom_psu: fixed handling of not available power supplies
Multisite:
* 2684 Added icons for downloading agent data / walks of hosts...
diff --git a/checks/pandacom_psu b/checks/pandacom_psu
index 43c5414..dd6f648 100644
--- a/checks/pandacom_psu
+++ b/checks/pandacom_psu
@@ -53,10 +53,11 @@ def parse_pandacom_psu(info):
"255" : "type not available",
}
map_psu_state = {
- "0" : (3, "not installed"),
- "1" : (2, "fail"),
- "2" : (1, "temperature warning"),
- "3" : (0, "pass"),
+ "0" : (3, "not installed"),
+ "1" : (2, "fail"),
+ "2" : (1, "temperature warning"),
+ "3" : (0, "pass"),
+ "255" : (3, "not available"),
}
parsed = {}
for psu_nr, type_index, state_index in [
@@ -64,7 +65,7 @@ def parse_pandacom_psu(info):
("2", 6, 3),
("3", 10, 11),
]:
- if info[state_index][0] != "0":
+ if info[state_index][0] not in [ "0", "255" ]:
parsed[psu_nr] = {
"type" : map_psu_type[info[type_index][0]],
"state" : map_psu_state[info[state_index][0]],