Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 428628 - sys-block/megacli monitoring script
Summary: sys-block/megacli monitoring script
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Sysadmin Bugs
Depends on:
Reported: 2012-07-30 08:59 UTC by Oleg Gawriloff
Modified: 2016-02-09 00:57 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Note You need to log in before you can comment on or make changes to this bug.
Description Oleg Gawriloff 2012-07-30 08:59:47 UTC
It would be nice if we have some kind of daily monitoring for megaraid arrays. Based on
in /etc/cron.daily/mega-status:

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 
megacli -PdList -aALL - get the list of drives and its ID:
Enclosure Device ID: 252
Slot Number: 4
Inquiry Data:             9VS2ZCM5ST31500341AS                            CC1H

peerbox-r1 bin # megacli -PDRbld -ShowProg -PhysDrv [252:4] -aALL
Rebuild Progress on Device at Enclosure 252, Slot 4 Completed 6% in 34 Minutes.
Comment 1 Lance Albertson (RETIRED) gentoo-dev 2012-12-24 18:12:26 UTC
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?

Comment 2 Oleg Gawriloff 2013-01-07 17:05:25 UTC
Yes, anything that does the job will do.
Comment 3 Kevin Bonner 2013-07-31 06:50:43 UTC
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.

Comment 4 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2016-02-09 00:57:11 UTC
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.