Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mail_bp_notify modification assistance please

Status
Not open for further replies.

CalgaryCR9

Technical User
Aug 12, 2005
80
CA
We are running NetBackup 6.0 M4, on Solaris 9 and 10.

Nightly mail_bp_reports is run and sent to our team. It is a tad bit incomplete in my opinion. I'd like to modify the script to include the KB of data backed up. It reports a 0 status (successful) when 32KB backed up for a full backup. Misleading.

I need the communities assistance in modifying this script.

Our script look like this:
#!/bin/bash
#***************************************************************************
# Netbackup Reporting Script - - April 6 2006
#***************************************************************************
#
# mail_bp_reports
TODAY=`date +'%b %e'`
#
BPERROR=/usr/openv/netbackup/bin/admincmd/bperror

# HOST is the name of the host being monitored
HOST=`uname -n`

# HOURS is the number of hours in the reporting cycle.
HOURS=24

OUTFILE=/usr/local/storage/backup/tmp/bpstat
OUTFILE1=/usr/local/storage/backup/tmp/bpstat.1

/bin/rm -rf $OUTFILE $OUTFILE1
touch $OUTFILE $OUTFILE1

# -------------------------------------
$BPERROR -U -backstat -hoursago $HOURS 1>>$OUTFILE 2>&1
echo "" >> $OUTFILE1
cat $OUTFILE | sort -k3 >>$OUTFILE1 2>&1
echo " " >> $OUTFILE1
echo "---------------------------" >> $OUTFILE1
echo "Backup Disk Usage" >>$OUTFILE1
echo "---------------------------" >> $OUTFILE1
echo " " >> $OUTFILE1
df -h | grep R200 | cut -c 74-105 | sort -k2 >>$OUTFILE1
echo " " >> $OUTFILE1
echo "--------------------------------------------------------------------" >> $OUTFILE1
echo "Mounted Filesystems for the Mail Store Backup" >> $OUTFILE1
echo "--------------------------------------------------------------------" >> $OUTFILE1
echo "" >> $OUTFILE1
df -h | grep backup | cut -c 60-100 | sort -k 2 >>$OUTFILE1
echo "" >> $OUTFILE1
echo "-----------------------------------------------------------------------------------" >> $OUTFILE1
echo "Checking the connected fibre" >>$OUTFILE1
echo "-----------------------------------------------------------------------------------" >> $OUTFILE1
echo "" >> $OUTFILE1
luxadm -e port >>$OUTFILE1
echo "" >> $OUTFILE1
echo "-----------------------------------------------------------------------------------" >> $OUTFILE1
echo "The total of R200 filesystems mounted should be 41" >> $OUTFILE1
for x in `cat /opt/home/cpare/Backup/R200-list`;do ls $x | /bin/grep lost+found; done | /bin/grep lost | wc -l
>> $OUTFILE1
echo "-----------------------------------------------------------------------------------" >> $OUTFILE1
echo "The total of backup filesystems mounted should be 40" >> $OUTFILE1
echo "-----------------------------------------------------------------------------------" >> $OUTFILE1
for y in `cat /opt/home/cpare/Backup/Backup-list`;do ls $y | /bin/grep lost+found; done | /bin/grep lost | /bin/wc -l >> $OUTFILE1
echo "-----------------------------------------------------------------------------------" >> $OUTFILE1
echo "The total of nightly clones created and mapped should be 40" >> $OUTFILE1
echo "-----------------------------------------------------------------------------------" >> $OUTFILE1
/bin/grep mapped /var/adm/messages* | /bin/grep -v unmapped | /bin/grep "$TODAY" | sort -t . -k 4 | /bin/wc -l
>> $OUTFILE1
echo "-----------------------------------------------------------------------------------" >> $OUTFILE1
cat $OUTFILE1 | /usr/local/storage/SCBmail/scbmail -s "$HOST NetBackup $HOURS Hours Report" -r user@company.ca
#cat $OUTFILE1 | /usr/local/storage/SCBmail/scbmail -s "$HOST NetBackup $HOURS Hours Report" -r user@company.ca
# -------------------------------------

The output looks like:
STATUS CLIENT POLICY SCHED SERVER TIME COMPLETED
0 pd2nc1so-bck pd2nc1so-bck Differenti pd2bs1so-bc 07/16/2007 00:00:54
0 pd2bs1so-bck pd2bs1so-bck Differenti pd2bs1so-bc 07/16/2007 00:01:53

Recently Used Media:

Media ID Last Written Server
-------- ---------------- ----------
C00009 07/16/2007 00:00 pd2bs1so-bck
C00239 07/16/2007 00:03 pd2bs1so-bck
C00187 07/16/2007 00:02 pd2bs1so-bck
C00242 07/16/2007 00:02 pd2bs1so-bck
C00186 07/16/2007 00:00 pd2bs1so-bck
C00237 07/16/2007 00:00 pd2bs1so-bck
C00131 07/16/2007 00:00 pd2bs1so-bck
C00185 07/16/2007 00:00 pd2bs1so-bck
C00047 07/16/2007 00:00 pd2bs1so-bck
C00241 07/16/2007 00:00 pd2bs1so-bck

I'd like to see the headers be:
STATUS CLIENT POLICY SCHED SERVER TIME COMPLETED KBytes BACKED UP

Thanks in advance for any assistance. As mentioned before, I am struggling to remember how I did these things 6 years ago! :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top