periodic/daily: show verbose zpool status when errors are detected
When zpool status -x reports errors, the output only shows basic error counts without identifying which files are affected. Replace the unconditional echo of the brief status with verbose output (zpool status -v) in the error path so administrators can see exactly which files have been damaged. The healthy/no-pools path still shows the brief status. PR: 223243 Signed-off-by: Po Han Chen <hypery11@gmail.com> Reviewed by: imp, jlduran, asomers Pull Request: https://github.com/freebsd/freebsd-src/pull/2089
This commit is contained in:
@@ -25,13 +25,15 @@ case "$daily_status_zfs_enable" in
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
sout=`zpool status -x`
|
sout=`zpool status -x`
|
||||||
echo "$sout"
|
|
||||||
# zpool status -x always exits with 0, so we have to interpret its
|
# zpool status -x always exits with 0, so we have to interpret its
|
||||||
# output to see what's going on.
|
# output to see what's going on.
|
||||||
if [ "$sout" = "all pools are healthy" \
|
if [ "$sout" = "all pools are healthy" \
|
||||||
-o "$sout" = "no pools available" ]; then
|
-o "$sout" = "no pools available" ]; then
|
||||||
|
echo "$sout"
|
||||||
rc=0
|
rc=0
|
||||||
else
|
else
|
||||||
|
# Show verbose status so we can see which files are affected
|
||||||
|
zpool status -v
|
||||||
rc=1
|
rc=1
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|||||||
Reference in New Issue
Block a user