Created
March 18, 2011 10:13
-
-
Save dsturnbull/875850 to your computer and use it in GitHub Desktop.
This file contains hidden or 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/ksh | |
# Public domain. Use as you wish. | |
EMAIL=admins@darkstar | |
TMPFILE=/tmp/fmadm.output.$$ | |
export PATH=/usr/bin:/usr/sbin | |
# | |
# run fmadm and cut away the first two lines | |
# | |
fmadm faulty >$TMPFILE | |
# | |
# check if the file size is greater than zero | |
# which means we got some output from fmadm and | |
# therefore some hardware may be bad | |
# | |
if [ -s $TMPFILE ]; then | |
cat $TMPFILE | mailx -s "Hardware failed on `hostname`" $EMAIL | |
fi | |
rm -f $TMPFILE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment