From 42b4a64371505c3edf08aa921e74d4c9390d07c0 Mon Sep 17 00:00:00 2001 From: bouyer Date: Sun, 27 Jan 2002 22:08:50 +0000 Subject: [PATCH] If check_disks=YES, check for failed components in RAIDframe devices. --- etc/daily | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/etc/daily b/etc/daily index 3271e9f578fc..1b2b5a3e7366 100644 --- a/etc/daily +++ b/etc/daily @@ -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 @@ if checkyesno check_disks; then 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