#!/bin/sh # name: checkdisk_net # # checkdisk_net, host02_checkdisk, and host03_checkdisk scripts # check predictive disk failure on the hosts. # # Described in the BigAdmin submitted tech tip: # http://www.sun.com/bigadmin/content/submitted/net_sys_autocheck.jsp # MAIL_RECEIVER= PATH=/usr/bin; export PATH # Check disk errors for host01 if iostat -En | egrep "Media Error: 1|Predictive Failure Analysis: 1" > /dev/null then echo "Use iostat -En to diagnose\n" > /tmp/diskerror.txt iostat -En | egrep "Media Error: 1|Predictive Failure Analysis: 1" >> /tmp/diskerror.txt mailx -s "host01 Disk Error" $MAIL_RECEIVER < /tmp/diskerror.txt fi # Check disk errors for host02 HOST02_DISKERROR=/net/host02/report/host02_diskerror.txt if [ -f $HOST02_DISKERROR ] then mailx -s "host02 Disk Error" $MAIL_RECEIVER < $HOST02_DISKERROR rm $HOST02_DISKERROR fi # Check disk errors for host03 HOST03_DISKERROR=/net/host02/report/host03_diskerror.txt if [ -f $HOST03_DISKERROR ] then mailx -s "host03 Disk Error" $MAIL_RECEIVER < $HOST03_DISKERROR rm $HOST03_DISKERROR fi ############################################################################## ### This script is submitted to BigAdmin by a user of the BigAdmin community. ### Sun Microsystems, Inc. is not responsible for the ### contents or the code enclosed. ### ### ### Copyright Sun Microsystems, Inc. ALL RIGHTS RESERVED ### Use of this software is authorized pursuant to the ### terms of the license found at ### http://www.sun.com/bigadmin/common/berkeley_license.jsp ##############################################################################