[lug] Mylex RAID Monitor

Rob Nagler nagler at bivio.net
Tue Sep 11 10:52:35 MDT 2001


> Is there a program that will monitor/alert for
> a Mylex RAID controller?

http://www.dandelion.com/Linux/README.DAC960 sez:

 To simplify the monitoring process for custom software, the special file
 /proc/rd/status returns "OK" when all DAC960 controllers in the system are
 operating normally and no failures have occurred, or "ALERT" if any logical
 drives are offline or critical or any non-standby physical drives are dead.

We monitor the system logs on a regular basis.  The monitoring program
is quite simple.  We run it from cron.  It reads the logs, throws out
lines which match our ignored patterns, and spits it to stdout.

Here's the bit of our code that checks our mylex and linux raid drives:

sub check_raid {
    my($mdfile) = '/proc/mdstat';
    if (open(F, $mdfile)) {
        while (<F>) {
            /^md\d+.+_/ && print("WARNING: $mdfile: $_");
        }
        close(F);
    }
    my($mylex_status) = '/proc/rd/status';
    if (open(F, $mylex_status )) {
        my($status);
	$status = <F>;
        close(F);
        if ($status !~ /^OK/) {
            print("WARNING: $mylex_status: $status");
            system("grep Critical /proc/rd/*/current_status");
        }
    }
}

Hope this helps,
Rob



More information about the LUG mailing list