I do not recall where I got this or who wrote it so I cannot give due credit to a really good script ... Here is what I use:
#!/bin/ksh
#
#########################################################################
#
# Script to report average throughput for the previous nights backups.
#
# Creation Date: July 17th, 2003
# Modification Date: July 17th, 2003
#
#########################################################################
#########################################################################
#
# Set up variables
MASTER=<your Master server>
BPDIR=<your Install dir>/netbackup/bin/admincmd
AWKPROG=<location for results>/awk.prog
STATS=<location for results>/nb.stats
OUTPUT=<location for results>/Global_Drive_Thruput.txt
hoursago=72 Change this to the number of hours to query against
ADMCMD=<your Install dir>/netbackup/bin/admincmd
#########################################################################
#
# Initialize Log Files
#
if [ -s $AWKPROG ]
then
rm $AWKPROG
fi
if [ -s $STATS ]
then
rm $STATS
fi
if [ -s $OUTPUT ]
then
rm $OUTPUT
fi
#########################################################################
#
# Perform actions
thruputformat() {
echo "\n => Backup <=" >>$OUTPUT
cat $STATS | grep -v duplicate | grep -v restore |
awk -F\, '{print $NF}' |
awk -f $AWKPROG >>$OUTPUT
echo "\n => Duplicate <=" >>$OUTPUT
cat $STATS | grep duplicate |
awk -F\, '{print $NF}' |
awk -f $AWKPROG >>$OUTPUT
echo "\n => Restore <=" >>$OUTPUT
cat $STATS | grep restore |
awk -F\, '{print $NF}' |
awk -f $AWKPROG >>$OUTPUT
echo "" >> $OUTPUT
echo "<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><" >> $OUTPUT
echo "" >> $OUTPUT
}
#
# End Functions
#
# Create an awk program file to be used later
echo '
BEGIN {bytes=0;thruput=0;items=0}
$2=="Kbytes" && $3=="at" {bytes+=$1; thruput+=$4;items++}
$1=="total" && $2=="Kbytes" {bytes+=$3; thruput+=$5;items++}
$2=="total" && $5=="Kbytes" {bytes+=$4; thruput+=$7;items++}
END {
print "Total Volume: " bytes/1024 " Mbytes";
if (items>0) {print "Average Throughput: " thruput/items " KBytes/sec "int(((thruput/items)*60)/1024) " MBytes/min"}
}
'> $AWKPROG
#
# Here is where the real script BEGINS
#
# First we want to make sure that no jobs are active
# this will provide more accurate thruput results.
#
$ADMCMD/bpdbjobs -M $MASTER -report | grep Active >/dev/null
#
# Set variable NOJOBS to the return code of previous line
# if it returned a zero (0), then the condition of the
# until loop is met. If not, we stay in the until
# loop until it is met, sleeping for 10 minutes each
# time the condition is not met
#
#
#
NOJOBS=$?
until [ $NOJOBS -ne 0 ]
do
sleep 600
$admcmd/bpdbjobs -M $MASTER -report | grep Active >/dev/null
NOJOBS=$?
done
#
# Now the report can be run on the thruput.
#
$ADMCMD/bperror -M $MASTER -hoursago $hoursago|grep Kbytes/sec > $STATS
echo "===============================================================================" >>$OUTPUT
echo "\t`date`\n" >>$OUTPUT
echo "Global Thruput Summary Report of Master Server $MASTER " >> $OUTPUT
echo "Reporting on the previous $hoursago hours" >>$OUTPUT
echo "===============================================================================" >>$OUTPUT
#
# Call Thruput function
thruputformat
#
# Find all Media Servers to report on
#
$ADMCMD/bpstulist -L | grep Host | sort -u| awk '{print $3}' |
while read mediaserver
do
$ADMCMD/bperror -M $MASTER -server $mediaserver -hoursago $hoursago |
grep Kbytes/sec > $STATS
echo "===============================================================================" >>$OUTPUT
echo "\n\t`date`" >>$OUTPUT
echo "Individual Thruput Summary Report of Media Server:$mediaserver" >>$OUTPUT
echo "Reporting on the previous $hoursago hours" >>$OUTPUT
echo "===============================================================================" >>$OUTPUT
#
# Call Thruput function
thruputformat
#
done
#
# Uncomment if you want this to be delivered to someone_who_cares
#cat $OUTPUT | mailx -s "Throughput Statistics Summary" $someone_who_cares
rm -f $AWKPROG $STATS