Module: check_mk
Branch: master
Commit: 061ba50810877303c4d7137dc50a78d71216ba3d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=061ba508108773…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Dec 16 19:34:47 2013 +0100
FIX megaraid_ldisks: Ignoring adapters without configured logical disks
Previous versions of this check did simply fail with an exception if an
adapter has no logical disks configured. This change makes the inventory
function simply ignore those adapters.
---
.werks/372 | 12 ++++++++++++
ChangeLog | 1 +
checks/megaraid_ldisks | 4 +++-
3 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/.werks/372 b/.werks/372
new file mode 100644
index 0000000..9cb2c21
--- /dev/null
+++ b/.werks/372
@@ -0,0 +1,12 @@
+Title: megaraid_ldisks: Ignoring adapters without configured logical disks
+Level: 1
+Component: checks
+Class: fix
+State: unknown
+Version: 1.2.5i1
+Date: 1387218819
+Targetversion: future
+
+Previous versions of this check did simply fail with an exception if an
+adapter has no logical disks configured. This change makes the inventory
+function simply ignore those adapters.
diff --git a/ChangeLog b/ChangeLog
index 29b2b20..29d5c02 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -41,6 +41,7 @@
* 0343 FIX: postgres_sessions: make agent plugin compatible with PostgreSQL 9.2...
* 0369 FIX: cups_queues: Fixed bug checking the last queue reported by agent...
* 0370 FIX: brocade_mlx_module*: Improved output of checks
+ * 0372 FIX: megaraid_ldisks: Ignoring adapters without configured logical disks...
Multisite:
* 0371 Added log class filter to hostsvcevents view
diff --git a/checks/megaraid_ldisks b/checks/megaraid_ldisks
index d09fbce..c6c7d29 100644
--- a/checks/megaraid_ldisks
+++ b/checks/megaraid_ldisks
@@ -31,12 +31,14 @@
# State: Optimal
# Stripe Size: 64kB
# Number Of Drives:2
+# Adapter 1: No Virtual Drive Configured.
def inventory_megaraid_ldisks(info):
inventory = []
adapter = None
for line in info:
- if line[0] == "Adapter":
+ l = ' '.join(line)
+ if line[0] == "Adapter" and not l.endswith('No Virtual Drive
Configured.'):
adapter = int(line[1])
elif line[0] == "Virtual" and (line[1] == "Disk:" or line[1]
== "Drive:"):
disk = int(line[2])