Checking the status of ATA raids in periodic daily ?

Jesper Skriver jesper at FreeBSD.org
Fri Oct 24 17:17:07 PDT 2003


Hi,

Any objections if I commit the below diff, and add the attached file as
src/etc/periodic/daily/405.status-ata_raid ?

Index: defaults/periodic.conf
===================================================================
RCS file: /home/ncvs/src/etc/defaults/periodic.conf,v
retrieving revision 1.25
diff -u -r1.25 periodic.conf
--- defaults/periodic.conf	1 Apr 2003 17:45:27 -0000	1.25
+++ defaults/periodic.conf	25 Oct 2003 00:15:52 -0000
@@ -85,6 +85,9 @@
 daily_status_disks_enable="YES"				# Check disk status
 daily_status_disks_df_flags="-k -t nonfs"		# df(1) flags for check
 
+# 405.status-ata_raid
+status_ata_raid_enable="YES"				# Check ATA raid status
+
 # 420.status-network
 daily_status_network_enable="YES"			# Check network status
 daily_status_network_usedns="YES"			# DNS lookups are ok
Index: periodic/daily/Makefile
===================================================================
RCS file: /home/ncvs/src/etc/periodic/daily/Makefile,v
retrieving revision 1.11
diff -u -r1.11 Makefile
--- periodic/daily/Makefile	1 Apr 2003 20:32:01 -0000	1.11
+++ periodic/daily/Makefile	25 Oct 2003 00:15:52 -0000
@@ -12,6 +12,7 @@
 	310.accounting \
 	330.news \
 	400.status-disks \
+	405.status-ata_raid \
 	420.status-network \
 	430.status-rwho \
 	440.status-mailq \


/Jesper

-- 
Jesper Skriver, jesper(at)skriver(dot)dk  -  CCIE #5456

One Unix to rule them all, One Resolver to find them,
One IP to bring them all and in the zone to bind them.
-------------- next part --------------
#!/bin/sh
#
# $FreeBSD: $
#

# If there is a global system configuration file, suck it in.
#
if [ -r /etc/defaults/periodic.conf ]
then
    . /etc/defaults/periodic.conf
    source_periodic_confs
fi

case "$daily_status_ata_raid_enable" in
    [Yy][Ee][Ss])
	echo
	echo 'Checking status of ATA raid partitions:'

	rc=0

	for raid in `/usr/bin/find /dev/ -name 'ar[0-9]*' -type c \
		| /usr/bin/egrep '[0-9]$' | /usr/bin/egrep -v 's[0-9]' \
		| cut -d / -f 3`
	     do
		status=`/sbin/atacontrol status $raid`
		echo $status
		raid_rc=`echo $status | grep -v READY | wc -l`
		[ $rc -eq 0 ] && [ $raid_rc -gt 0 ] && rc=3
	     done
	;;

    *)  rc=0;;
esac

exit $rc


More information about the freebsd-current mailing list