It would be nice if we have some kind of daily monitoring for megaraid arrays. Based on http://www.bxtra.net/comment/137. in /etc/cron.daily/mega-status: #!/bin/bash megacli -PdList -aALL | awk -f /root/bin/mega-status.awk | grep -Ev "*: Online" in /root/bin/mega-status.awk: # 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]); } So in case of failure we have nice message: peerbox-r1 bin # /etc/cron.daily/mega-status Device 12 (9VS2ZCM5ST31500341AS CC1H ) status is: Rebuild PS: May be some further commands should be added, i.e. in case of rebuild Using: megacli -PdList -aALL - get the list of drives and its ID: Enclosure Device ID: 252 Slot Number: 4 Inquiry Data: 9VS2ZCM5ST31500341AS CC1H then peerbox-r1 bin # megacli -PDRbld -ShowProg -PhysDrv [252:4] -aALL Rebuild Progress on Device at Enclosure 252, Slot 4 Completed 6% in 34 Minutes.
I've used a modified version of this nagios plugin from the nagios exchange [1] to deal with the monitoring of megaraid devices. I don't think having a cronjob by default is a good decision, however I don't have a problem of including this in a contrib folder. Will that be OK? [1] http://exchange.nagios.org/directory/Plugins/Hardware/Storage-Systems/RAID-Controllers/check_snmp_raid--2F-check_sasraid_megaraid/details
Yes, anything that does the job will do.
We use a modified version of check_megaraid_sas from the Nagios Exchange[1]. I see the check_sasraid_megaraid was updated within the past few months (rather than 3+ years), but wanted to provide an alternative that I've had success with for a couple years. [1] http://exchange.nagios.org/directory/Plugins/Hardware/Storage-Systems/RAID-Controllers/check_megaraid_sas/details
If anybody still cares about this, package check_megaraid_sas from nagios directly, and include an optional cronjob to check it; leave the megacli ebuild itself alone.