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
--nextPart1264709.7HuygFCvsh Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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= =20 get removed. =2DHarry #!/bin/sh # Written by Harald Schmalzbauer (harry@schmalzbauer.de), 10/20/05, use it= =20 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" !=3D "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`" !=3D "X" ]; then classes_present=3D"$classes_present $class" fi done for class in $classes_present; do eval ${class}_providers=3D\"`g$class list | grep "Geom name" | cut -d "= "=20 =2Df 3`\" if [ "X`eval echo \\$${class}_providers`" !=3D "X" ]; then echo " geom_$class:" fi for name in `eval echo \\$${class}_providers`; do if [ "X`g$class status $name | grep COMPLETE`" =3D "X" ]; then echo "ERROR!!!" g$class status $name rc=3D3 else echo " Provider $name is OK" fi done done rc=3D1 else rc=3D0 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= =20 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=3D1 card=3D0 cards=3D`sysctl dev.twe | grep location | wc -l` echo echo "Hardware RAID status:" while [ $cards -gt $card ] do unit=3D0 units=3D`sysctl dev.twed | grep "%parent: twe$card" | wc -l` while [ $units -gt $unit ] do info=3D`sysctl -n dev.twed.$unit | grep "Unit $unit"` raid=3D`echo $info | cut -d " " -f 3` status=3D`echo $info | cut -d " " -f 4` echo Controller `expr $card + 1`: `sysctl -n dev.twe.$card.%desc` echo " Unit `expr $unit + 1`: $raid Status=3D$status" if [ "$status" !=3D "Normal" ]; then rc=3D3; fi unit=3D$(expr $unit + 1) done card=3D$(expr $card + 1) done ;; *) rc=3D0;; esac exit $rc > > +> # 405.status-ata_raid > +> daily_status_ata_raid_enable=3D"NO" # Check ATA raid status > +> + > +> +# 406.status-gmirror > +> +daily_status_gmirror_enable=3D"NO" # Check gmirror(8) > > Why we turn off those two by default? > It is really not expensive to get state of the mirrors. --nextPart1264709.7HuygFCvsh Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (FreeBSD) iD8DBQBDy6N/Bylq0S4AzzwRAkSBAKCKg2kdFSdiYnC6ukadek9VqvuoMQCfYCR8 gEbzCiSb+UnapKvtDaBAq0k= =I5Pz -----END PGP SIGNATURE----- --nextPart1264709.7HuygFCvsh--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200601161445.35436>