MegaCLI for LSI MegaRAID on Linux

Here at SANBI we have a bunch of Dell blade servers, including Dell M620s. These have on-board LSI MegaRAID controllers (the SAS 2208 to be exact), and recently I had a need to pull some diagnostic info from the controller (because our drives mysteriously went offline, one after another, a couple of days apart). We’re running Ubuntu 12.04 on the servers, and luckily there is a command line tool, MegaCLI, that you can use to interface with the RAID controller. You can get it from the LSI website, but its a bit of a hunt. Here is a link to version 8.05.71, which is a zip file that I simply extracted into /opt. The tool has a bewildering number of options (shown with MegaCli64 -h) but there are guides to useful commands here and here.