From owner-freebsd-current@FreeBSD.ORG Fri Oct 24 17:17:07 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 085D916A4B3 for ; Fri, 24 Oct 2003 17:17:07 -0700 (PDT) Received: from freesbee.wheel.dk (freesbee.wheel.dk [193.162.159.97]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0315443FD7 for ; Fri, 24 Oct 2003 17:17:06 -0700 (PDT) (envelope-from jesper@skriver.dk) Received: by freesbee.wheel.dk (Postfix, from userid 1001) id 359C03852E; Sat, 25 Oct 2003 02:17:05 +0200 (CEST) Date: Sat, 25 Oct 2003 02:17:05 +0200 From: Jesper Skriver To: current@FreeBSD.org Message-ID: <20031025001704.GA20863@FreeBSD.org> Mail-Followup-To: Jesper Skriver , current@FreeBSD.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="qMm9M+Fa2AknHoGS" Content-Disposition: inline User-Agent: Mutt/1.4.1i X-PGP-Fingerprint: 6B88 9CE8 66E9 E631 C9C5 5EB4 22AB F0EC F956 1C31 X-PGP-Public-Key: http://freesbee.wheel.dk/~jesper/gpgkey.pub Subject: Checking the status of ATA raids in periodic daily ? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Oct 2003 00:17:07 -0000 --qMm9M+Fa2AknHoGS Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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. --qMm9M+Fa2AknHoGS Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="405.status-ata_raid" #!/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 --qMm9M+Fa2AknHoGS--