Skip to main content

Many IBM xSeries servers come with LSI Logic MegaRAID RAID controllers, under the name IBM ServerRAID.

These can be accessed during the machine boot process via the BIOS screens using a conventional BIOS-like text interface or a ghastly and painful to use GUI interface. However, either of these requires the machine OS to be down.

The RAID adapters can also be accessed while the machine OS is up. For Linux, IBM offer a set of command line tools named MegaCLI, which are installed in /opt/MegaRAID. Unfortunately, their MegaCLI executable is both fiddly to invoke and in its reporting mode, produces a barely human readable report which is quite hostlie to machine parsing. I would surmise that someone was told to dump the adapter data in text form, and did so with an ad hoc report; it is pages long and arduous to inspect by eye.

The situation was sufficiently painful that I wrote this module which runs a couple of the report modes and parses their output. It is deliberately python 2.4 compatible so that it can run on RHEL 5 systems.

Report Mode

The “report” mode then dumps a short summary report of relevant information which can be eyeballed immediately; RAID configuration and issues are immediately apparent. Here is an example output (the “+” tracing lines are on stderr, and recite the underlying MegaCLI commands used):

# mcli report
+ exec py26+ -m cs.app.megacli report
+ exec /opt/MegaRAID/MegaCli/MegaCli64 -CfgDsply -aAll
+ exec /opt/MegaRAID/MegaCli/MegaCli64 -PDlist -aAll
Adapter 0 IBM ServeRAID-MR10i SAS/SATA Controller serial# Pnnnnnnnnn
  Virtual Drive 0
    2 drives, size = 278.464GB, raid = Primary-1, Secondary-0, RAID Level Qualifier-0
      physical drive enc252.devid8 [252:0]
      physical drive enc252.devid7 [252:1]
  4 drives:
    enc252.devid7 [252:1]: VD 0, DG None: 42D0628 279.396 GB, Online, Spun Up
    enc252.devid8 [252:0]: VD 0, DG None: 81Y9671 279.396 GB, Online, Spun Up
    enc252.devid2 [252:2]: VD None, DG None: 42D0628 279.396 GB, Unconfigured(good), Spun Up
    enc252.devid3 [252:3]: VD None, DG None: 42D0628 279.396 GB, Unconfigured(good), Spun Up

Status Mode

The “status” mode recites the RAID status in a series of terse one line summaries; we use its output in our nagios monitoring. Here is an example output (the “+” tracing lines are on stderr, and recite the underlying MegaCLI commands used):

# mcli status
+ exec py26+ -m cs.app.megacli status
+ exec /opt/MegaRAID/MegaCli/MegaCli64 -CfgDsply -aAll
+ exec /opt/MegaRAID/MegaCli/MegaCli64 -PDlist -aAll
OK A0

Locate Mode

The “locate” mode prints a MegaCLI command line which can be used to activate or deactivate the location LED on a specific drive. Here is an example output:

# mcli locate 252:4
/opt/MegaRAID/MegaCli/MegaCli64 -PdLocate -start -physdrv[252:4] -a0

# mcli locate 252:4 stop
/opt/MegaRAID/MegaCli/MegaCli64 -PdLocate -stop -physdrv[252:4] -a0

New_RAID Mode

The “new_raid” mode prints a MegaCLI command line which can be used to instruct the adapter to assemble a new RAID set.

MegaCLI class

The module provides a MegaCLI class which embodies the parsed information from the MegaCLI reporting modes. This can be imported and used for special needs.

Release files for cs-app-megacli 20160226

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cs-app-megacli 20160226
File Size Uploaded
cs.app.megacli-20160226.tar.gz 7.8 kB Details

Release files / cs.app.megacli-20160226.tar.gz

Download URL cs.app.megacli-20160226.tar.gz
Size 7.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b353a50a8f02d8fec335d25c1f5fc713a342c857390f83baf6ed6ead6d113388
BLAKE2b-256 checksum
How to use checksums
64580a2d2fddf23c4e3410f88465bb6afc93349ae34d3e2e9cfedbad72859da3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

20160226 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page