On Thu, Oct 4, 2012 at 9:45 AM, Jim Klimov <jimkli...@cos.ru> wrote: > 2012-10-04 20:36, Freddie Cash пишет: >> >> On Thu, Oct 4, 2012 at 9:14 AM, Richard Elling <richard.ell...@gmail.com> >> wrote: >>> >>> On Oct 4, 2012, at 8:58 AM, Jan Owoc <jso...@gmail.com> wrote: >>> The return code for zpool is ambiguous. Do not rely upon it to determine >>> if the pool is healthy. You should check the health property instead. >> >> >> Huh. Learn something new everyday. You just simplified my "pool >> health check" script immensely. Thank you! >> >> pstatus=$( zpool get health storage | grep "health" | awk '{ print $3 }' ) >> if [ "${pstatus}" != "ONLINE" ]; then > > > Simplify that too with "zpool list": > > # zpool list -H -o health rpool > ONLINE
Thanks! Was trying to figure out how to remove the heading as I use -H a lot with zfs commands, but it didn't work for "zpool get" and I didn't bother reading to figure it out. :) -- Freddie Cash fjwc...@gmail.com _______________________________________________ zfs-discuss mailing list zfs-discuss@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/zfs-discuss