Module: check_mk
Branch: master
Commit: 6273cabe089c62c09ec1cdb5e2300ba83e0a7cc1
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6273cabe089c62…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Fri Nov 16 14:05:44 2018 +0100
6814 FIX hp_msa_if: Do not crash if no speed information is available
Change-Id: Ifd54f51489deb65da55934aedaf28156d8ce0961
---
.werks/6814 | 10 ++++++++++
checks/hp_msa_if | 6 +++---
2 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/.werks/6814 b/.werks/6814
new file mode 100644
index 0000000..62c3715
--- /dev/null
+++ b/.werks/6814
@@ -0,0 +1,10 @@
+Title: hp_msa_if: Do not crash if no speed information is available
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.6.0i1
+Date: 1542373485
+Class: fix
+
+
diff --git a/checks/hp_msa_if b/checks/hp_msa_if
index 4be6c06..da8a4af 100644
--- a/checks/hp_msa_if
+++ b/checks/hp_msa_if
@@ -124,10 +124,10 @@
def parse_hp_msa_if(info):
parsed = []
for idx, (_key, values) in enumerate(sorted(parse_hp_msa(info).iteritems())):
- if values['actual-speed'] == '':
- speed = values['actual-speed'] = 0
- else:
+ try:
speed = int(values['actual-speed'].replace('Gb', ''))
* 10**9
+ except ValueError:
+ speed = 0
if values['status'] == 'Up':
status = '1'