Problem
I have an OpenServer 6.0.0 or UnixWare 7.1.4 server with one of the LSI MegaRAID SAS controllers listed in the HARDWARE section below.
The server is using the 'megasas' HBA version 1.1 which is available at:
http://www.sco.com/support/download.htmlBut this driver package does not have any monitoring daemon to check on the condition of the SAS Raid set(s).
Is there any tool or utility that will allow me to check and monitor the SAS RAID set?
HARDWARE: LSI MegaRAID SAS 84016E
LSI MegaRAID SAS 8308ELP
LSI MegaRAID SAS 8304ELP
LSI MegaRAID SAS 8344ELP
LSI MegaRAID SAS 8408E
LSI MegaRAID SAS 8480E
LSI MegaRAID SAS 8300XLP
LSI MegaRAID SAS 8704ELP
LSI MegaRAID SAS 8704EM2
LSI MegaRAID SAS 8708ELP
LAI MegaRAID SAS 8708EM2
LSI MegaRAID SAS 8880ELP
LSI MegaRAID SAS 8888ELP
LSI MegaRAID SAS 8888EM2Dell PERC 5/i SAS Dell PERC 5/E SAS Dell PERC 6/i SAS Dell PERC 6/E SAS
Solution
There is a command line utility available from LSI called the "MegaCLI - Megaraid Command Line Interface" that can be used to check and monitor the SAS RAID Set.
The SCO Unix version of "MegaCLI", ver. 4.00.10, utility is avilable on LSI Website under:
http://www.lsi.com/DistributionSystem/AssetDocument/4.00.10_Sco_MegaCLI.zipIf the above URL is no longer valid, then visit the LSI generic download site under:
http://www.lsi.com/support/downloads/To install:Download from the above URL and unzip the file
4.00.10_Sco_MegaCLI.zip.There will be four files;4.00.10_Sco_MegaCLI.txt
MegaCli.bin (SCO Unix executable binary)
MegaCli (SCO Unix executable binary)
MegaCLI.image (SCO Unixware7 & OSR6 installable pkgadd
Package).Dont, use the The megaCLI.image because of a bug in the install script. You get this error message when "pkgadd" the image:
UX:pkginstall: ERROR: attempt to process package from </tmp/MegaCLI.image> failed - process </usr/bin/cpio -icdumD -C 512 2>/dev/null> failed, exit code 3 UX:pkginstall: ERROR: unable to unpack datastream
The best way to install is to copy and rename "MegaCli" file to /usr/sbin/megacli
Change the permission to 755.Usage:To see what options can be used with this command:
# megacli -h|?To see the "megacli" version:# megacli -vHere are a few useful options for the MegaCLI command:
Please Note: In our server example, we have one LSI MegaRAID SAS 8300XLP controller with 4 36 GB SAS HD and two set of Raid-1 drives each 36 GB configured.
- How many Megaraid SAS controllers present?:
# megacli -AdpCountController Count: 1.- A complete report:# megacli -AdpAllinfo -a0Please Note: the option "-a0" idicates first controller. In our case we have only one LSI MegaRAID SAS controller.
- Report number of Physical drives connected:
# megacli -PDGetNum -a0Number of Physical drives on adapter 0: 4- Report number of Logical Drive Raid set:
# megacli -LDGetNum -a0Number of Virtual drives configured on adapter 0: 2
- Report all disks and enclosures:# megacli -PDList -a0Adapter #0Enclosure Device ID: 248
Slot Number: 0
Device Id: 0
Sequence Number: 2
Media Error Count: 0
Other Error Count: 0
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
Raw Size: 35003MB [0x445dccc Sectors]
Non Coerced Size: 34491MB [0x435dccc Sectors]
Coerced Size: 34464MB [0x4350000 Sectors]
Firmware state: Online
SAS Address(0): 0x5000c50000541ec9
SAS Address(1): 0x0
Connected Port Number: 0
Inquiry Data: SEAGATE ST336754SS 15033KQ1QNV2@#10F30Enclosure Device ID: 248
Slot Number: 1
Device Id: 1
Sequence Number: 2
Media Error Count: 0
Other Error Count: 0
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
Raw Size: 35003MB [0x445dccc Sectors]
Non Coerced Size: 34491MB [0x435dccc Sectors]
Coerced Size: 34464MB [0x4350000 Sectors]
Firmware state: Online
SAS Address(0): 0x5000c50000541f49
SAS Address(1): 0x0
Connected Port Number: 1
Inquiry Data: SEAGATE ST336754SS 15033KQ1PV38@#10F30Enclosure Device ID: 248
Slot Number: 2
Device Id: 2
Sequence Number: 2
Media Error Count: 0
Other Error Count: 0
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
Raw Size: 35003MB [0x445dccc Sectors]
Non Coerced Size: 34491MB [0x435dccc Sectors]
Coerced Size: 34464MB [0x4350000 Sectors]
Firmware state: Online
SAS Address(0): 0x5000c500005420e1
SAS Address(1): 0x0
Connected Port Number: 2
Inquiry Data: SEAGATE ST336754SS 15033KQ1QEH1@#10F30Enclosure Device ID: 248
Slot Number: 3
Device Id: 3
Sequence Number: 2
Media Error Count: 0
Other Error Count: 0
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
Raw Size: 35003MB [0x445dccc Sectors]
Non Coerced Size: 34491MB [0x435dccc Sectors]
Coerced Size: 34464MB [0x4350000 Sectors]
Firmware state: Offline
SAS Address(0): 0x5000c50000542aad
SAS Address(1): 0x0
Connected Port Number: 3
Inquiry Data: SEAGATE ST336754SS 15033KQ1QBKE@#10F30From the above output, we can see four 36 GB physical drives.
To address individual physical drive, you need to know the Enclosure Device ID & Slot Number.
For example, Physical Drive 3 has the following SAS ID's:
Enclosure Device ID = 248 Slot Number = 2
In order to get status report on the third physical drive, the "megacli" command syntax will look like this:
# megacli -pdInfo -PhysDrv[248:2] -a0Enclosure Device ID: 248
Slot Number: 2
Device Id: 2
Sequence Number: 2
Media Error Count: 0
Other Error Count: 0
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
Raw Size: 35003MB [0x445dccc Sectors]
Non Coerced Size: 34491MB [0x435dccc Sectors]
Coerced Size: 34464MB [0x4350000 Sectors]
Firmware state: Online
SAS Address(0): 0x5000c500005420e1
SAS Address(1): 0x0
Connected Port Number: 2
Inquiry Data: SEAGATE ST336754SS 15033KQ1QEH1@#10F30- Report Raid set status:# megacli -LDInfo -Lall -a0Adapter 0 -- Virtual Drive Information: Virtual Disk: 0 (target id: 0) Name: RAID Level: Primary-1, Secondary-0, RAID Level Qualifier-0 Size:34464MB State: Optimal Stripe Size: 64kB Number Of Drives:2 Span Depth:1 Default Cache Policy: WriteThrough, ReadAheadNone, Direct, No Write Cache if Bad BBU Current Cache Policy: WriteThrough, ReadAheadNone, Direct, No Write Cache if Bad BBU Access Policy: Read/Write Disk Cache Policy: Disabled Virtual Disk: 1 (target id: 1)
Name: RAID Level: Primary-1, Secondary-0, RAID Level Qualifier-0 Size:34464MB State: Degraded Stripe Size: 64kB Number Of Drives:2 Span Depth:1 Default Cache Policy: WriteThrough, ReadAheadNone, Direct, No Write Cache if Bad BBU Current Cache Policy: WriteThrough, ReadAheadNone, Direct, No Write Cache if Bad BBU Access Policy: Read/Write Disk Cache Policy: Disabled
To display the first Logical drive raid set:
# megacli -LDInfo -L0 -a0To display the second Logical drive raid set:
# megacli -LDInfo -L1 -a0You can create cron jobs to call a shell script wrapper around the 'megacli' command that can check the condition of the Raid set and individual physical drive.
And if any abnormal output is displayed then send an email to the system administrators to inform them of the abnormality.
Here are some examples:- to check the condition of Logical drive Raid set 1:
# megacli -LDInfo -L0 -a0 | grep State | cut -f2 -d":"OptimalHere the raid set is OPTIMAL.- to check the condition of Logical drive Raid set 2:
# megacli -LDInfo -L1 -a0 | grep State | cut -f2 -d":"DegradedHere the raid set is DEGRADED. Then action is needed to be taken.
- To check the condition of a Physical Drive No. 1
# megacli -pdInfo -PhysDrv[248:0] -a0 | grep Firmware |
cut -f2 -d":"OnlineHere first Physical drive is ONLINE and OK.
- To check the condition of a Physical Drive No. 4
# megacli -pdInfo -PhysDrv[248:3] -a0 | grep Firmware |
cut -f2 -d":"OfflineHere the fourth physical drive is OFFLINE. Hens this is why the second logical raid set has "DEGRADED" status. Action is needed to be taken.