Created
August 6, 2012 19:54
-
-
Save Lukasa/3277961 to your computer and use it in GitHub Desktop.
A script to test the health of ZFS pools.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script checks the state of all zpools. If an error is found, it | |
# emails the contents of zpool status to the administrator. | |
mkdir -p ~/.zpool_status | |
cd ~/.zpool_status | |
result=`zpool status -x` | |
if [ "$result" == "all pools are healthy" ]; then | |
exit 0 | |
else | |
zpool status > status.txt | |
send_email status.txt | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment