#!/bin/csh -f # # run errpt and print the errors for the last 24 hours email to root # # Set global variables set RECP = "kinscoe@cbis.com" @ D24 = `/bin/date '+%d'` @ D24 = $D24 - 1 set M24 = `/bin/date '+%m'` set MD24 = `/bin/echo $M24$D24` set H24 = `/bin/date '+%H%M%y'` set T24 = `/bin/echo $MD24$H24` set DATE = `/bin/date '+%C%y%m%d'` set COUNT = `/usr/bin/errpt -s $T24 | /bin/wc -l` /bin/echo "There have been" $COUNT "errors generated in the last 24 hours as of" `/bin/date` /bin/echo "start date:" $T24 set SUBJ1 = `/bin/echo $DATE": SUMMARY OF AIX ERRORS LOGGED FOR "; /bin/hostname; /bin/echo " "\($COUNT\)` set SUBJ2 = `/bin/echo $DATE": DETAIL OF AIX ERRORS LOGGED FOR "; /bin/hostname; /bin/echo " "\($COUNT\)` # summary report /usr/bin/errpt -s $T24 | /usr/bin/mailx -s `/bin/echo $SUBJ1` $RECP # detail report /usr/bin/errpt -s $T24 -a | /usr/bin/mailx -s `/bin/echo $SUBJ1` $RECP