12-20-2008 01:56 AM
12-20-2008 08:24 PM
12-24-2008 06:59 AM
I am NOT the author.
I found this on the internet but it has some good ideas and I modified it to suit my needs.
#!/bin/kshPATH=$PATH:/usr/openv/netbackup/bin/admincmd:/usr/openv/localOUTFILE=/var/tmp/`basename $0`.$$.outMAILADDR="Netbackup.Reports"cols=92hours=24if [ -n "$1" ] then if [ $1 -gt 0 ] then hours=$1 else echo "Usage: `basename $0` [hours]" exit 1 fifiecho "## Problem Summary..." >$OUTFILEbperror -columns $cols -U -backstat -by_statcode -hoursago $hours | \ awk 'BEGIN {switch=0} {if ( $1>0 && $1~/^[0-9][0-9]*$/ ) {switch=1} if ( switch==1 ) { if ( $1~/^[0-9][0-9]*$/ ) {print} else { count=0 while ( ++count <= NF ) { print "\t\t" $count } } } }' >>$OUTFILEsvrlist=`bperror -columns $cols -U -backstat -by_statcode -hoursago $hours | \ awk 'BEGIN {switch=0} {if ( $1>0 && $1~/^[0-9][0-9]*$/ ) {switch=1} if ( switch==1 && $1!~/^[0-9][0-9]*$/) { count=0 while ( ++count <= NF ) {print $count}}}' | sort -u`echo "\n## Problem Detail by server..." >>$OUTFILEfor each in $svrlistdo echo "\n## Client: $each" >>$OUTFILE bperror -client $each -columns $cols -U -problems -hoursago $hours >>$OUTFILEdonecp $OUTFILE /usr/openv/netbackup/logs/scripts/problems.rpt.lastrunif [ `egrep -vc "^ *$|^#" $OUTFILE` -gt 0 ] ; then for recip in $MAILADDR ; do mailx -s "NB Rpt: ${hours}hr Rpt:Problems Report" $MAILADDR <$OUTFILE donefi[ -f $OUTFILE ] && rm -f $OUTFILEexit
12-28-2008 04:56 PM