Subject: misc/14094: RAID array status isn't reported in daily jobs
To: None <gnats-bugs@gnats.netbsd.org>
From: None <dave@dtsp.co.nz>
List: netbsd-bugs
Date: 09/29/2001 04:40:03
>Number:         14094
>Category:       misc
>Synopsis:       RAID array status isn't reported in daily jobs
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    misc-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Fri Sep 28 21:35:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     David Sainty
>Release:        20010901
>Organization:
Dynamic Technology Services and Products Ltd (NZ)
>Environment:
System: NetBSD tequila.dave.dtsp.co.nz 1.5X NetBSD 1.5X (TEQUILA) #1: Wed Sep 26 18:47:35 NZST 2001 dave@tequila.dave.dtsp.co.nz:/vol/usr/userC/NetBSD-current/src/sys/arch/i386/compile/TEQUILA i386
Architecture: i386
Machine: i386
>Description:
	If a RAID array component has failed, but no-one is watching the
	console, it doesn't make a noise.  Unless you count the sound of the
	drive head scraping against the platter :)

	Included patch adds support to /etc/daily to do a brief health report
	on all arrays defined in /etc/raid*.conf, if any.

>How-To-Repeat:
	Notice how quietly a RAID component can fail, wonder how long it would
	take to notice on a redundant array...

>Fix:
Patch defaults to enabled checks, because with no configuration files the
report is silent.  The report could likely be improved on, but it's a good
start - the important thing is to see the component list and whether any have
failed.

--- src/etc/daily.orig	Sat Sep  1 19:05:05 2001
+++ src/etc/daily	Sat Sep 29 15:05:03 2001
@@ -193,6 +193,19 @@
 	fi
 fi
 
+if checkyesno check_raid; then
+	for cfg in /etc/raid[0-9].conf /etc/raid[0-9][0-9].conf; do
+		[ ! -f "$cfg" ] && continue
+		dev=${cfg##*/}
+		dev=${dev%%.conf}
+
+		echo ""
+		echo "RAID: Array status for ${dev}:"
+		# Strip out the component label dump...
+		raidctl -s "$dev" | awk -- '/^[A-Za-z]/ {show=1} /^Component label for/ {show=0} {if (show) print "  " $0; }'
+	done
+fi
+
 if checkyesno run_fsck; then
 	echo ""
 	echo "Checking filesystems:"
--- src/etc/defaults/daily.conf.orig	Sat Nov 11 15:36:06 2000
+++ src/etc/defaults/daily.conf	Sat Sep 29 15:04:42 2001
@@ -18,6 +18,7 @@
 check_disks=YES
 check_mailq=YES
 check_network=YES
+check_raid=YES
 run_fsck=NO
 run_rdist=YES
 run_security=YES
>Release-Note:
>Audit-Trail:
>Unformatted: