kern/173614: /etc/periodic/daily/404.status.zfs wrong

peter håkanson peter at ipsec.se
Tue Nov 13 21:00:01 UTC 2012


>Number:         173614
>Category:       kern
>Synopsis:       /etc/periodic/daily/404.status.zfs wrong
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Nov 13 21:00:00 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     peter håkanson
>Release:        8.2 amd64
>Organization:
ipsec sverige
>Environment:
FreeBSD bore.hk.ipsec.se 8.1-RELEASE-p5 FreeBSD 8.1-RELEASE-p5 #0: Tue Sep 27 16:18:26 UTC 2011     root at i386-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  i386
And others !
>Description:
The 404.status.zfs does not report a broken vdev.

Attatched is a modified 404.status.zfs that work both on a broken vdev and a correct one
>How-To-Repeat:
use it on a machine with zfs 
>Fix:
#!/bin/sh
#
# $FreeBSD: src/etc/periodic/daily/404.status-zfs,v 1.1.10.1.6.1 2010/12/21 17:09:25 kensmith Exp $
# made working by peter h IPSec 2012
#

# 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_zfs_enable" in
    [Yy][Ee][Ss])
        echo
        echo 'Checking status of zfs pools:'

        out=`zpool status -x`
        echo "$out"
        # assume fail
        rc=1
        # zpool status -x always exits with 0, so we have to interpret its
        # output to see what's going on.
        if  ( echo $out | grep -q "state: DEGRADED"  ) ; then
                rc=1
        fi
        if ( echo $out | grep -q "all pools are healthy" ) ; then 
                rc=0
        fi
        ;;

    *)
        rc=0
        ;;
esac
exit $rc




>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list