Module: check_mk
Branch: master
Commit: 4c156d1866cf418083b5500568c14b2a0714810f
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4c156d1866cf41…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Fri May 18 14:54:07 2018 +0200
6129 FIX megaraid_ldisks: Fixed crash if item not found
Change-Id: Ie164c39311bb4da22ae7c9dd2e7a829a680c5fca
---
.werks/6129 | 11 +++++++++++
checks/megaraid_ldisks | 3 +++
2 files changed, 14 insertions(+)
diff --git a/.werks/6129 b/.werks/6129
new file mode 100644
index 0000000..0c6214d
--- /dev/null
+++ b/.werks/6129
@@ -0,0 +1,11 @@
+Title: megaraid_ldisks: Fixed crash if item not found
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1526648029
+
+
diff --git a/checks/megaraid_ldisks b/checks/megaraid_ldisks
index 797b791..4dcd90a 100644
--- a/checks/megaraid_ldisks
+++ b/checks/megaraid_ldisks
@@ -76,6 +76,9 @@ def inventory_megaraid_ldisks(parsed):
def check_megaraid_ldisks(item, _no_params, parsed):
+ if item not in parsed:
+ return
+
raidstate = parsed[item]["state"]
if raidstate == "Optimal":
yield 0, "State is %s" % raidstate