diff --git a/bundles/zfs/files/check_zpool_online b/bundles/zfs/files/check_zpool_online index 9fb0cae..0e7c16c 100644 --- a/bundles/zfs/files/check_zpool_online +++ b/bundles/zfs/files/check_zpool_online @@ -5,11 +5,14 @@ if [ $# -eq 0 ] ; then exit 3 fi -if [ "$(zpool status "$1" | grep '^ state:')" = ' state: ONLINE' ] +status="$(zpool status "$1")" + +if [ "$(echo "$status" | grep '^ state:')" = ' state: ONLINE' ] then echo "OK - Pool '$1' is online" exit 0 else echo "CRITICAL - Pool '$1' is FAULTY or NOT ONLINE" + echo "$status" exit 2 fi