Dell Perc6/i RAID Monitoring Script using MegaCli (LSI) on CentOS 5.2 - 64 bits

I got a Dell Perc6/i Integrated RAID card a few days ago. By using it with CentOS 5.2 64 bits without GUI, I'm looking the way to monitor RAID status. I then, found that I can use MegaCLI from LSI to do the task. (Dell Perc6/i uses LSI Chip)

First, get MegaCLI from LSI website -> MegaCLI 2.00.11 for Linux

Unzip it, and install it by RPM. Files will place at /opt/MegaRAID/MegaCli. However, since I use 64 bits version, the file I got is MegaCli64. (32 bits OS will get MegaCli instead.

I, then, followed what said on this website (Most information came from that website.)

1. Created a file called "analysis.awk" in the /opt/MegaRAID/MegaCli directory with the following contents:

# This is a little AWK program that interprets MegaCLI output

    /Device Id/ { counter += 1; device[counter] = $3 }
    /Firmware state/ { state_drive[counter] = $3 }
    /Inquiry/ { name_drive[counter] = $3 " " $4 " " $5 " " $6 }
    END {
    for (i=1; i<=counter; i+=1) printf ( "Device %02d (%s) status is: %s \n", device[i], name_drive[i], state_drive[i]); }

2. Tested by run the command : ./MegaCli64 -PDList -aALL | awk -f analysis.awk

[root@xxxxx MegaCli]# ./MegaCli64 -PDList -aALL | awk -f analysis.awk
Device 00 (ATA ST3xxxxxxxx Sxxx 5xxxxx) status is: Online
Device 01 (ATA ST3xxxxxxxx Sxxx 5xxxxx) status is: Online

3. Create a file raidstatus in /etc/cron.hourly. Put below script in it :

/opt/MegaRAID/MegaCli/MegaCli64 -PdList -aALL | awk -f /opt/MegaRAID/MegaCli/analysis.awk | grep -qEv "*: Online" > /dev/null && echo "Warning: RAID status no longer optimal"

4. Run below command to make the file executable by all users.

chmod a+x /etc/cron.hourly/raidstatus

5. Check where the e-mail notification goes to in CRONTAB. Check this file -> /etc/crontab


# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly

I didn't change anything in CRONTAB. Instead, I changed that in /etc/aliases file. Specify root : in there. So, that all mail to root will go to

There is no e-mail notification if you run cron task (run-parts /etc/cron.hourly) by yourself. So, you need to wait for CRON to run automatically and you will get an E-mail.

Below are command that maybe useful :

Command to list Adapter Information :

/opt/MegaRAID/MegaCli/MegaCli64 -AdpAllInfo -aAll

Command to List all Logical Drives :

/opt/MegaRAID/MegaCli/MegaCli64 -LDInfo -LALL -aAll

Command to list all Physical Information :

/opt/MegaRAID/MegaCli/MegaCli64 -PDList -aAll

To check if cron works, run command :

run-parts /etc/cron.hourly


thanks for your good article!

As I said in French, Thank You, very usefull.

Many thanks to the original poster... you are a lifesaver The link to MegaCLI is dead, but you can find old versions of MegaCLI on LSI's US website... but even better... you can find newest versions of MegaCLI on the Japanese website:

since the MegaCLI at LSI only comes as an .rpm... this is tough for OpenFiler users (with no rpm or alien on the system).. and for some reason the 2.00 version wouldnt work for me.. but 4.00.11 did! Install Alien: wget tar vzxf alien_8.72.tar.gz cd alien perl Makefile.PL make make install Convert the .rpm: /usr/bin/alien --to-tgz /tmp/MegaCli-4.00.11-1.i386.rpm Warning: Skipping conversion of scripts in package MegaCli: postinst postrm Warning: Use the --scripts parameter to include the scripts. cpio: warning: skipped 2167399 bytes of junk MegaCli-4.00.11.tgz generated Extract the *single* MegaCli file (you dont need all the /opt/Mega..blah blah directory structure).. I ran it from my home directory Note: I was NOT able to use MegaCLI64 even though Im on a 64-bit system with 64-bit flavor of openfiler... it generated segmentation faults everytime chmod 755 MegaCli ./MegaCli -h Enjoy! This burned up 1 1/2 days for me... so thought I would pass it along!

It's very helpful to me. Thanks again!! :)

I loved it. Thanks a much!

Lovely, with a little bit of tweaking I made it to do what I want, thanks!!!

Hey guys Just wondering if anyone could point me to the download of megacli64, I've tried the above links, but dont seem to ever find it. I need to do some raid health monitoring over Xen's paravirtualised driver layer, and this is the only way to connect with MSM. If someone could pass me a link, I'd appreciate it. Thanks, Nick

Try Or pick the one for the card you use from MegaCLI usually located in "Miscellaneous" topic (Asset Type). I still saw version 8.02.21 which just released on Jun 7, 2012.

It is GREAT, helpful

i have a ibm server 4252 and i find the megacli over ibm site but don't know hoe istall it. i ask my assistance and the cost fos it is 250 €. can you help me to installa it ? thanks

Perfect, Works like a Charm

Great article thanks - worked perfectly on DELL R320 series server with CentOS 6

Got the latest MegaCLI code from:

Your examples were just what I needed - I owe you a beer (or two).

Thanks again!

If you think you have taken an excessive amount of of this medication contact a poison manipulate center or emergency room straight away. For men or boys: If you're giving your own injections, and miss a dose, take it as soon as you keep in mind. If you forget until tomorrow, skip the neglected dose and maintain along with your schedule. Do no longer use double or more doses. Call your health practitioner when you have any questions.

Mainly found in brewer’s yeast, deficiency in chromium impairs the metabolism of glucose. Evidence helps chromium for lower blood sugar and A1c levels. Be cautious when you have kidney ailment with this complement. Those with diabetes are generally found to be zinc deficient. Studies have proven zinc supplementation can lessen blood sugar and A1C, have an antioxidant effect, decrease blood sugar and even help treat a number of the headaches associated with diabetes. Large doses of zinc can inhibit the absorption of other minerals like copper, so make sure to ask for guidance of the precise dosing.

These are huge, U-shaped scars which have sharp edges. They may be shallow or deep. The shallower they may be, the better they respond to pores and skin resurfacing remedies. Ice pick scars are slim, V-fashioned scars that can pass deep into the skin. They can appear to be small round or oval holes, like a chickenpox scar. These are the maximum tough scars to treat because they can make bigger some distance under the surface of the pores and skin.

According to the Ayurvedic subculture, Triphala has the houses to deal with an nearly encyclopedic variety of health situations. Some of this is attributed to Triphala's laxative effect, which proponents advocate can "cleanse the gadget." Depending on how plenty is prescribed, Triphala may be used as bowel tonic at lower doses, alleviating fuel and promoting digestion, or a purgative (strong laxative) at higher doses.

Dental Implants Are little titanium "Root-Form" screws, which are put in your jawbone by an Implantologist to supplant absent or bombing teeth. Subsequent to mending, the dental specialist will reestablish your inserts and spot crowns on top.

Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.