Date: Mon, 16 Jan 2006 14:45:27 +0100 From: Harald Schmalzbauer <harry@schmalzbauer.de> To: cvs-src@freebsd.org Cc: src-committers@freebsd.org, Pawel Jakub Dawidek <pjd@freebsd.org> Subject: Re: cvs commit: src/etc/defaults periodic.conf src/etc/periodic/daily 406.status-gmirror Message-ID: <200601161445.35436@harrymail> In-Reply-To: <20060115193627.GA1258@garage.freebsd.pl> References: <200601131807.k0DI7qAO073535@repoman.freebsd.org> <20060115193627.GA1258@garage.freebsd.pl>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
Am Sonntag, 15. Januar 2006 20:36 CEST schrieb Pawel Jakub Dawidek:
> On Fri, Jan 13, 2006 at 06:07:52PM +0000, Garrett Wollman wrote:
> +> wollman 2006-01-13 18:07:52 UTC
> +>
> +> FreeBSD src repository
> +>
> +> Modified files:
> +> etc/defaults periodic.conf
> +> Added files:
> +> etc/periodic/daily 406.status-gmirror
> +> Log:
> +> Add a daily script to show the status of gmirror(8) devices.
>
> Cool, thanks! Maybe you can also prepare periodic script for graid3(8)
> as well?:) Or maybe this one can be made more general?
I already sent him a more general one, I'll paste it here since attachments
get removed.
-Harry
#!/bin/sh
# Written by Harald Schmalzbauer (harry@schmalzbauer.de), 10/20/05, use it
at your own risk!
# 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
if [ "X$daily_status_geom_raid_classes" != "X" ]; then
echo
echo "Checking the following GEOM Raid classes:"
for class in $daily_status_geom_raid_classes; do
if [ "X`sysctl kern.geom.$class 2>/dev/null`" != "X" ]; then
classes_present="$classes_present $class"
fi
done
for class in $classes_present; do
eval ${class}_providers=\"`g$class list | grep "Geom name" | cut -d " "
-f 3`\"
if [ "X`eval echo \\$${class}_providers`" != "X" ]; then
echo " geom_$class:"
fi
for name in `eval echo \\$${class}_providers`; do
if [ "X`g$class status $name | grep COMPLETE`" = "X" ]; then
echo "ERROR!!!"
g$class status $name
rc=3
else
echo " Provider $name is OK"
fi
done
done
rc=1
else
rc=0
fi
exit $rc
And here ist the one for 3ware controllers:
#!/bin/sh
# Written by Harald Schmalzbauer (harry@schmalzbauer.de), 10/20/05, use it
at your own risk!
# 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_twe_raid_enable" in
[Yy][Ee][Ss])
rc=1
card=0
cards=`sysctl dev.twe | grep location | wc -l`
echo
echo "Hardware RAID status:"
while [ $cards -gt $card ]
do
unit=0
units=`sysctl dev.twed | grep "%parent: twe$card" | wc -l`
while [ $units -gt $unit ]
do
info=`sysctl -n dev.twed.$unit | grep "Unit $unit"`
raid=`echo $info | cut -d " " -f 3`
status=`echo $info | cut -d " " -f 4`
echo Controller `expr $card + 1`: `sysctl -n dev.twe.$card.%desc`
echo " Unit `expr $unit + 1`: $raid Status=$status"
if [ "$status" != "Normal" ]; then rc=3; fi
unit=$(expr $unit + 1)
done
card=$(expr $card + 1)
done
;;
*) rc=0;;
esac
exit $rc
>
> +> # 405.status-ata_raid
> +> daily_status_ata_raid_enable="NO" # Check ATA raid status
> +> +
> +> +# 406.status-gmirror
> +> +daily_status_gmirror_enable="NO" # Check gmirror(8)
>
> Why we turn off those two by default?
> It is really not expensive to get state of the mirrors.
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (FreeBSD)
iD8DBQBDy6N/Bylq0S4AzzwRAkSBAKCKg2kdFSdiYnC6ukadek9VqvuoMQCfYCR8
gEbzCiSb+UnapKvtDaBAq0k=
=I5Pz
-----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200601161445.35436>
