{"id":249,"date":"2009-11-08T02:38:00","date_gmt":"2009-11-08T02:38:00","guid":{"rendered":"http:\/\/blog.trungson.com\/?p=249"},"modified":"2009-11-08T02:38:00","modified_gmt":"2009-11-08T02:38:00","slug":"monitor-lsi-megaraid-under-centos","status":"publish","type":"post","link":"http:\/\/blog.trungson.com\/?p=249","title":{"rendered":"Monitor LSI MegaRAID under CentOS"},"content":{"rendered":"<p>Not very user friendly with documentation but I guess at least it runs!<\/p>\n<p><textarea name=\"code\" class=\"xml\"><br \/>\n$ wget http:\/\/www.lsi.com\/DistributionSystem\/AssetDocument\/support\/downloads\/megaraid\/miscellaneous\/linux\/1.01.39_Linux_Cli.zip<\/p>\n<p>$ unzip 1.01.39_Linux_Cli.zip<\/p>\n<p>$ rpm -Uvh MegaCli-1.01.39-0.i386.rpm<\/p>\n<p>$ \/opt\/MegaRAID\/MegaCli\/MegaCli64 -AdpAllInfo -a0<br \/>\n<\/textarea><\/p>\n<h4>Basic Monitor Script<\/h4>\n<p><textarea name=\"code\" class=\"xml\"><br \/>\n#!\/bin\/sh<br \/>\nCONT=&#8221;a0&#8243;<br \/>\nSTATUS=0<br \/>\nMEGACLI=\/opt\/MegaRAID\/MegaCli\/MegaCli64<\/p>\n<p>echo -n &#8220;Checking RAID status on &#8221;<br \/>\nhostname<br \/>\nfor a in $CONT<br \/>\ndo<\/p>\n<p>NAME=`$MEGACLI -AdpAllInfo -$a |grep &#8220;Product Name&#8221; | cut -d: -f2`<br \/>\necho &#8220;Controller $a: $NAME&#8221;<br \/>\nnoonline=`$MEGACLI PDList -$a | grep Online | wc -l`<br \/>\necho &#8220;No of Physical disks online : $noonline&#8221;<br \/>\nDEGRADED=`$MEGACLI -AdpAllInfo -a0 |grep &#8220;Degrade&#8221;`<br \/>\necho $DEGRADED<br \/>\nNUM_DEGRADED=`echo $DEGRADED |cut -d&#8221; &#8221; -f3`<br \/>\n[ &#8220;$NUM_DEGRADED&#8221; -ne 0 ] &#038;&#038; STATUS=1<br \/>\nFAILED=`$MEGACLI -AdpAllInfo -a0 |grep &#8220;Failed Disks&#8221;`<br \/>\necho $FAILED<br \/>\nNUM_FAILED=`echo $FAILED |cut -d&#8221; &#8221; -f4`<br \/>\n[ &#8220;$NUM_FAILED&#8221; -ne 0 ] &#038;&#038; STATUS=1<\/p>\n<p>done<\/p>\n<p>exit $STATUS<br \/>\n<\/textarea><\/p>\n<p>Sample Output<\/p>\n<pre>\nChecking RAID status on xxx\nController a0:  MegaRAID SAS 8344ELP\nNo of Physical disks online : 4\nDegraded : 0\nFailed Disks : 0\n<\/pre>\n<h4>Upgrade Firmware<\/h4>\n<p>To determine the current firmware, run &#8220;MegaCli -AdpAllInfo -a0&#8221;<\/p>\n<pre>\nProduct Name    : MegaRAID SAS 8344ELP\nSerial No       : P00253390X\nFW Package Build: 7.0.1-0064\n\n                    Mfg. Data\n                ================\nMfg. Date       : 09\/27\/06\nRework Date : 00\/00\/00\nRevision No     : 8\n\n                Image Versions In Flash:\n                ================\nBoot Block Version : R.2.3.15\nBIOS Version       : MT33\nMPT Version        : MPTFW-01.18.79.00-IT\nFW Version         : 1.12.220-0560\nWebBIOS Version    : 1.1-33g-e_11-Rel\nCtrl-R Version     : 1.04-019A\n<\/pre>\n<p>Check the LSi website for the current downloads, in this case: <\/p>\n<p>http:\/\/www.lsi.com\/storage_home\/products_home\/internal_raid\/megaraid_sas\/megaraid_sas_8344elp\/index.html<\/p>\n<pre>\n- Download the firmware, unzip\n- Run \"MegaCli -adpfwflash -f SAS1068_FW_Image.rom -a0\"\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Not very user friendly with documentation but I guess at least it runs! $ wget http:\/\/www.lsi.com\/DistributionSystem\/AssetDocument\/support\/downloads\/megaraid\/miscellaneous\/linux\/1.01.39_Linux_Cli.zip $ unzip 1.01.39_Linux_Cli.zip $ rpm -Uvh MegaCli-1.01.39-0.i386.rpm $ \/opt\/MegaRAID\/MegaCli\/MegaCli64 -AdpAllInfo -a0 Basic Monitor Script #!\/bin\/sh CONT=&#8221;a0&#8243; STATUS=0 MEGACLI=\/opt\/MegaRAID\/MegaCli\/MegaCli64 echo -n &#8220;Checking RAID status on &#8221; hostname for a in $CONT do NAME=`$MEGACLI -AdpAllInfo -$a |grep &#8220;Product Name&#8221; | cut [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"_links":{"self":[{"href":"http:\/\/blog.trungson.com\/index.php?rest_route=\/wp\/v2\/posts\/249"}],"collection":[{"href":"http:\/\/blog.trungson.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.trungson.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.trungson.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.trungson.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=249"}],"version-history":[{"count":0,"href":"http:\/\/blog.trungson.com\/index.php?rest_route=\/wp\/v2\/posts\/249\/revisions"}],"wp:attachment":[{"href":"http:\/\/blog.trungson.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=249"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.trungson.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=249"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.trungson.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=249"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}