Module: check_mk
Branch: master
Commit: 2168ee9b6d0f98bfe071e98ef6f3adedcf398815
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2168ee9b6d0f98…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Jul 2 09:02:49 2015 +0200
#2394 FIX megaraid_ldisks: Is now supporting LSI CacheCade drives
---
.werks/2394 | 10 ++++++++++
ChangeLog | 1 +
checks/megaraid_ldisks | 12 ++++++++----
3 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/.werks/2394 b/.werks/2394
new file mode 100644
index 0000000..f0778fe
--- /dev/null
+++ b/.werks/2394
@@ -0,0 +1,10 @@
+Title: megaraid_ldisks: Is now supporting LSI CacheCade drives
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i3
+Date: 1435820550
+
+
diff --git a/ChangeLog b/ChangeLog
index ae5ddf7..084f217 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -27,6 +27,7 @@
* 1261 FIX: apc_symmetra_power: Ignore unused phases during discovery
* 2320 FIX: winperf_msx_queues: no longer crashes in service discovery if there are
no msx queues available
* 2321 FIX: process discovery: fixed exception during service discovery when no
explicit process matching was set...
+ * 2394 FIX: megaraid_ldisks: Is now supporting LSI CacheCade drives
Multisite:
* 2385 SEC: Fixed possible reflected XSS on all GUI pages where users can produce
unhandled exceptions...
diff --git a/checks/megaraid_ldisks b/checks/megaraid_ldisks
index bb56eb5..fe9d0e9 100644
--- a/checks/megaraid_ldisks
+++ b/checks/megaraid_ldisks
@@ -33,6 +33,10 @@
# Number Of Drives:2
# Adapter 1: No Virtual Drive Configured.
+def megaraid_ldisks_is_new_drive(l):
+ return l.startswith('Virtual Disk:') or l.startswith('Virtual
Drive:') \
+ or l.startswith('CacheCade Virtual Drive:')
+
def inventory_megaraid_ldisks(info):
inventory = []
adapter = None
@@ -40,8 +44,8 @@ def inventory_megaraid_ldisks(info):
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])
+ elif megaraid_ldisks_is_new_drive(l):
+ disk = int(l.split(': ')[1].split(' ')[0])
inventory.append( ("%d/%d" % (adapter, disk), "", None)
)
return inventory
@@ -56,10 +60,10 @@ def check_megaraid_ldisks(item, _no_params, info):
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:"):
+ elif megaraid_ldisks_is_new_drive(l):
if found:
break
- disk = int(line[2])
+ disk = int(l.split(': ')[1].split(' ')[0])
found = "%d/%d" % (adapter, disk) == item
elif found:
if line[0].startswith("State"):