Subject: Re: raid status in /etc/daily
To: Manuel Bouyer <bouyer@antioche.eu.org>
From: Luke Mewburn <lukem@wasabisystems.com>
List: tech-userlevel
Date: 01/27/2002 12:12:40
On Sat, Jan 26, 2002 at 10:26:47PM +0100, Manuel Bouyer wrote:
| Hi,
| With raid device, a failed disk may stay unnoticed for long, if noone runs
| a raidctl -s on the device to check the status.
| The attached patch checks for failed components in raid devices, and produce
| an output like this:
| failed RAID component(s):
| raid1:
| /dev/sd2e: failed
|
| I've it on several of my machines, and it helped at last one time.
| would anyone object if I commit it ?
Yes. iostat is /usr/sbin. That is why I've held off making a similar
change myself.
simonb allegedly has patches to sysctl to allow you to extract the list
of active drives from the sysctl MIB; when he gets around to committing
those, you can use /sbin/sysctl to extract the list of drives.
|
| --
| Manuel Bouyer <bouyer@antioche.eu.org>
| --
| Index: daily
| ===================================================================
| RCS file: /cvsroot/basesrc/etc/daily,v
| retrieving revision 1.45
| diff -u -r1.45 daily
| --- daily 2001/12/18 00:51:16 1.45
| +++ daily 2002/01/26 21:15:09
| @@ -157,9 +157,22 @@
| fi
| echo ""
| fi
| + rm -f $TMP $TMP2
| + touch $TMP2
| + 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 RAID component(s):"
| + cat $TMP2
| + fi
| + rm -f $TMP2
| fi
| -
| -rm -f $TMP $TMP2
|
| if checkyesno check_mailq; then
| mailq > $TMP
--
Luke Mewburn <lukem@wasabisystems.com> http://www.wasabisystems.com
Luke Mewburn <lukem@netbsd.org> http://www.netbsd.org
Wasabi Systems - NetBSD hackers for hire
NetBSD - the world's most portable UNIX-like operating system