Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/etc If check_disks=YES, check for failed components in RAIDf...



details:   https://anonhg.NetBSD.org/src/rev/f358bc4f7540
branches:  trunk
changeset: 521298:f358bc4f7540
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Sun Jan 27 22:08:50 2002 +0000

description:
If check_disks=YES, check for failed components in RAIDframe devices.

diffstat:

 etc/daily |  19 ++++++++++++++++---
 1 files changed, 16 insertions(+), 3 deletions(-)

diffs (37 lines):

diff -r af07137e5dcc -r f358bc4f7540 etc/daily
--- a/etc/daily Sun Jan 27 22:00:40 2002 +0000
+++ b/etc/daily Sun Jan 27 22:08:50 2002 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh -
 #
-#      $NetBSD: daily,v 1.45 2001/12/18 00:51:16 lukem Exp $
+#      $NetBSD: daily,v 1.46 2002/01/27 22:08:50 bouyer Exp $
 #      @(#)daily       8.2 (Berkeley) 1/25/94
 #
 
@@ -157,10 +157,23 @@
                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 RAIDframe component(s):"
+                       cat $TMP2
+       fi
+       rm -f $TMP2
 fi
 
-rm -f $TMP $TMP2
-
 if checkyesno check_mailq; then
        mailq > $TMP
        if ! grep -q "queue is empty$" $TMP; then



Home | Main Index | Thread Index | Old Index