Module: check_mk
Branch: master
Commit: ba0ac4048d4803ee36f81d8285fc0b07707f16f7
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ba0ac4048d4803…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Apr 22 15:05:07 2016 +0200
3463 FIX ups_modulys_alarms: avoid crash on some SOCOMEC UPS where some alarm OIDs are
empty
---
.werks/3463 | 10 ++++++++++
ChangeLog | 1 +
checks/ups_modulys_alarms | 3 +--
3 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/.werks/3463 b/.werks/3463
new file mode 100644
index 0000000..f73594d
--- /dev/null
+++ b/.werks/3463
@@ -0,0 +1,10 @@
+Title: ups_modulys_alarms: avoid crash on some SOCOMEC UPS where some alarm OIDs are
empty
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.9i1
+Date: 1461330267
+
+
diff --git a/ChangeLog b/ChangeLog
index c904cc7..73e0baf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -179,6 +179,7 @@
* 3420 FIX: check_ftp, check_tcp, check_smtp: add missing CRIT levels for certificate
live time...
* 3421 FIX: cisco_asa_failover: Do not discover interfaces where failover is not
enabled...
* 3422 FIX: printer_pages, canon_pages: Detect pages on Canon 8350 with generic
check...
+ * 3463 FIX: ups_modulys_alarms: avoid crash on some SOCOMEC UPS where some alarm OIDs
are empty
Multisite:
* 3187 notification view: new filter for log command via regex
diff --git a/checks/ups_modulys_alarms b/checks/ups_modulys_alarms
index f49b6d2..0481fbf 100644
--- a/checks/ups_modulys_alarms
+++ b/checks/ups_modulys_alarms
@@ -32,7 +32,6 @@ def inventory_ups_modulys_alarms(info):
def check_ups_modulys_alarms(_no_item, _no_params, info):
-
oiddef = {
'1' : (2, 'Disconnect'),
'2' : (2, 'Input power failure'),
@@ -67,7 +66,7 @@ def check_ups_modulys_alarms(_no_item, _no_params, info):
for oidend, flag in info:
result = False
- if int(flag):
+ if flag and int(flag):
result = True
yield oiddef[oidend]