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

;)
//Jim
_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to