#!/bin/ksh -p # # This script will check ZFS filesystem health and send a text message # if there is a problem # ####################################################################### # # Variables: # Name of cellular carrier (Check Google Send to Phone for list) CARRIER=VERIZON # 10 digit cell phone number to send text message to PHONE_NUMBER=1234567890 # # Check overall ZFS health and if there is a problem report it ZFS_HEALTH=`zpool status -x` if [ "$ZFS_HEALTH" = "all pools are healthy" ]; then exit else ZFS_ERROR=`zpool status` # Send text message upon completion /ZFSDATA1/LOGS/sendtext.sh $CARRIER $PHONE_NUMBER " $ZFS_ERROR " fi exit # Add to crontab 1 * * * * /ZFSDATA1/LOGS/ZFShealth.ksh