#!/bin/bash
#< wrapper around check_iostat.sh to mail results if disk status has changed

CHECK_IOSTAT="/usr/local/bin/check_iostat.sh"
ECHO="/usr/bin/echo"
HOSTNAME="/bin/hostname"
MAILX="/usr/bin/mailx"
WC="/usr/bin/wc"

OUTPUT=$( ${CHECK_IOSTAT} )
if [ "${OUTPUT}" != "" ]; then
   ${ECHO} "${OUTPUT}" | ${MAILX} -s "$( ${HOSTNAME} ) - DISK STATUS ALERT" foo@bar.com
fi

exit 0