From owner-cvs-src@FreeBSD.ORG  Mon Jan 16 13:45:45 2006
Return-Path: <owner-cvs-src@FreeBSD.ORG>
X-Original-To: cvs-src@freebsd.org
Delivered-To: cvs-src@freebsd.org
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id B9EA816A41F;
	Mon, 16 Jan 2006 13:45:45 +0000 (GMT)
	(envelope-from harry@schmalzbauer.de)
Received: from flb.schmalzbauer.de (flb.schmalzbauer.de [62.245.232.135])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 7158343D45;
	Mon, 16 Jan 2006 13:45:39 +0000 (GMT)
	(envelope-from harry@schmalzbauer.de)
Received: from sam.flintsbach.schmalzbauer.de (sam.flintsbach.schmalzbauer.de
	[172.21.2.4])
	by flb.schmalzbauer.de (8.13.4/8.13.4) with ESMTP id k0GDktnN038326;
	Mon, 16 Jan 2006 14:46:55 +0100 (CET)
	(envelope-from harry@cale.flintsbach.schmalzbauer.de)
Received: from cale.flintsbach.schmalzbauer.de
	(cale.flintsbach.schmalzbauer.de [172.21.1.248])
	by sam.flintsbach.schmalzbauer.de (Postfix) with ESMTP id 7CF95B62D;
	Mon, 16 Jan 2006 14:45:37 +0100 (CET)
Received: from cale.flintsbach.schmalzbauer.de (localhost [127.0.0.1])
	by cale.flintsbach.schmalzbauer.de (8.13.4/8.13.4) with ESMTP id
	k0GDjaBf001671; Mon, 16 Jan 2006 14:45:36 +0100 (CET)
	(envelope-from harry@cale.flintsbach.schmalzbauer.de)
Received: from localhost (localhost [[UNIX: localhost]])
	by cale.flintsbach.schmalzbauer.de (8.13.4/8.13.4/Submit) id
	k0GDjZU9001670; Mon, 16 Jan 2006 14:45:35 +0100 (CET)
	(envelope-from harry@cale.flintsbach.schmalzbauer.de)
From: Harald Schmalzbauer <harry@schmalzbauer.de>
To: cvs-src@freebsd.org
Date: Mon, 16 Jan 2006 14:45:27 +0100
User-Agent: KMail/1.8.1
References: <200601131807.k0DI7qAO073535@repoman.freebsd.org>
	<20060115193627.GA1258@garage.freebsd.pl>
In-Reply-To: <20060115193627.GA1258@garage.freebsd.pl>
X-Birthday: Oct. 6th 1972
X-CelPhone: +49 (0) 173 9967781
X-Tel: +49 (0) 89 18947781
X-Country: Germany
X-Address: Munich, 80686
X-OS: FreeBSD
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="nextPart1264709.7HuygFCvsh";
	protocol="application/pgp-signature"; micalg=pgp-sha1
Content-Transfer-Encoding: 7bit
Message-Id: <200601161445.35436@harrymail>
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
X-BeenThere: cvs-src@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: CVS commit messages for the src tree <cvs-src.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/cvs-src>,
	<mailto:cvs-src-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/cvs-src>
List-Post: <mailto:cvs-src@freebsd.org>
List-Help: <mailto:cvs-src-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/cvs-src>,
	<mailto:cvs-src-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 16 Jan 2006 13:45:45 -0000

--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--