Module: check_mk
Branch: master
Commit: 1849ab9b3704ccc59f5da865c5b10479e1838a42
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1849ab9b3704cc…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Mon May 7 11:00:20 2018 +0200
5997 FIX brocade_sys: Fixed missing data handling which caused IndexError
Change-Id: I53f3fe93badb3d7758824dc5097363280614bdcc
---
.werks/5997 | 10 ++++++++++
checks/brocade_sys | 11 +++++++----
2 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/.werks/5997 b/.werks/5997
new file mode 100644
index 0000000..d0ca7b6
--- /dev/null
+++ b/.werks/5997
@@ -0,0 +1,10 @@
+Title: brocade_sys: Fixed missing data handling which caused IndexError
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.6.0i1
+Date: 1525683538
+Class: fix
+
+
diff --git a/checks/brocade_sys b/checks/brocade_sys
index b7a2262..ecb06ad 100644
--- a/checks/brocade_sys
+++ b/checks/brocade_sys
@@ -26,10 +26,13 @@
def parse_brocade_sys(info):
- return {
- "cpu_util" : int(info[0][0]),
- "mem_used_percent" : int(info[0][1]),
- }
+ try:
+ return {
+ "cpu_util" : int(info[0][0]),
+ "mem_used_percent" : int(info[0][1]),
+ }
+ except IndexError, ValueError:
+ return {}
# .--Memory--------------------------------------------------------------.