bundlewrap/bundles/zfs/files/check_zpool_online
2023-03-02 15:24:17 +01:00

16 lines
285 B
Bash
Executable file

#!/bin/bash
for pool in $(zpool get name -H -o value)
do
status=$(zpool get health -H -o value $pool)
if [ "$status" != ONLINE ]
then
errors="$error\"$pool\" status is $status\n"
fi
done
if [ "$errors" != "" ]
then
echo "CRITICAL - $errors"
exit 2
fi