Skip to content

Instantly share code, notes, and snippets.

Last active December 30, 2015 18:29
What would you like to do? checks the status of each zpool on the system and will send an email if all pools are not healthy. The check can be automated by adding the script to crontab.
# Check pool status.
# Linux
STATUS="$(/sbin/zpool status -x)"
# illumos
#STATUS="$(/usr/sbin/zpool status -x)"
echo "${STATUS}" | grep -qe "all pools are healthy"
if [ $? = 1 ]; then
echo "${STATUS}" | mail -s "ERROR: degraded pool on ${HOSTNAME}" ${EMAIL}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment