[RFC] [patch] periodic status-zfs: list pools in daily emails

Glen Barber gjb at FreeBSD.org
Tue Jun 28 20:42:33 UTC 2011


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 at FreeBSD.org
FreeBSD Documentation Project

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


More information about the freebsd-fs mailing list