From owner-freebsd-fs@FreeBSD.ORG Tue Jun 28 20:42:33 2011 Return-Path: Delivered-To: fs@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51508106564A for ; Tue, 28 Jun 2011 20:42:33 +0000 (UTC) (envelope-from gjb@onyx.glenbarber.us) Received: from glenbarber.us (onyx.glenbarber.us [199.48.134.227]) by mx1.freebsd.org (Postfix) with SMTP id 0313A8FC0C for ; Tue, 28 Jun 2011 20:42:32 +0000 (UTC) Received: (qmail 5003 invoked by uid 1001); 28 Jun 2011 16:32:28 -0400 Date: Tue, 28 Jun 2011 16:32:28 -0400 From: Glen Barber To: fs@FreeBSD.org Message-ID: <20110628203228.GA4957@onyx.glenbarber.us> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="qMm9M+Fa2AknHoGS" Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Subject: [RFC] [patch] periodic status-zfs: list pools in daily emails X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jun 2011 20:42:33 -0000 --qMm9M+Fa2AknHoGS Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, I'd like to get some feedback on a change I made to 404.status-zfs. I added a default behavior to list the pools on the system, in addition to checking if the pool is healthy. I think it might be useful for others to have this as the default behavior, for example on systems where dedup is enabled to track the dedup statistics over time. The output of the the script after my changes follows: Checking status of zfs pools: NAME SIZE ALLOC FREE CAP DEDUP HEALTH ALTROOT zroot 456G 147G 309G 32% 1.00x ONLINE - zstore 928G 258G 670G 27% 1.00x ONLINE - all pools are healthy Feedback would be appreciated. A diff is attached. Regards, -- Glen Barber | gjb@FreeBSD.org FreeBSD Documentation Project --qMm9M+Fa2AknHoGS Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="404.status-zfs.diff.txt" Index: 404.status-zfs =================================================================== --- 404.status-zfs (revision 223645) +++ 404.status-zfs (working copy) @@ -16,12 +16,14 @@ echo echo 'Checking status of zfs pools:' - out=`zpool status -x` - echo "$out" + lout=`zpool list` + echo "$lout" + sout=`zpool status -x` + echo "$sout" # zpool status -x always exits with 0, so we have to interpret its # output to see what's going on. - if [ "$out" = "all pools are healthy" \ - -o "$out" = "no pools available" ]; then + if [ "$sout" = "all pools are healthy" \ + -o "$sout" = "no pools available" ]; then rc=0 else rc=1 --qMm9M+Fa2AknHoGS--