Subject: Re: RAIDframe: notify me when a drive fails?
To: Geert Hendrickx <ghen@netbsd.org>
From: Tracy Di Marco White <netbsd@gendalia.org>
List: netbsd-users
Date: 02/28/2006 10:29:09
In message <20060228161647.GA13232@lori.ghen.be>, Geert Hendrickx writes:
>Hi, 
>
>can I configure raidframe to "do something" (e.g. send out an e-mail) when
>one of the drives goes bad?  Otherwise my RAID-1 is only good in theory...  

The daily script checks your raid's raidframe status.

        for dev in `iostat -x | awk '/^raid/ { print $1 }'`; do
                raidctl -s $dev | awk '/^.*: failed$/ {print $0}' > $TMP
                if [ -s $TMP ]; then
                        echo "$dev:" >> $TMP2
                        cat $TMP >> $TMP2
                fi
                rm -f $TMP
        done
        if [ -s $TMP2 ]; then
                echo "failed RAIDframe component(s):"
                        cat $TMP2
        fi

I use hobbit for monitoring my servers at work, and I've written
a raidframe check that reports to hobbit rather than relying on
the nightly notifications.

-Tracy