Tekkali
10 years agoLevel 4
Critical backup failure alerts
Hi All
Netbackup 7.5 / Solaris box
I need to get critical backup failures alerts script through bpstart.notify script.
Please suggest..
Hi
Ignore previous one
two files create one is for policy list mention all critical list "critical_policy_list "
Critical Policies Failed out put file Critical_Backup_Failures. but still not working check and suggest any thing wrong in script
# more /usr/openv/netbackup/bin/backup_exit_notify
#! /bin/sh
# $Header: backup_exit_notify.sh,v 1.4.28.1 2009/11/10 15:57:19 $
#bcpyrght
#***************************************************************************
#* $VRTScprght: Copyright 1993 - 2009 Symantec Corporation, All Rights Reserved $ *
#***************************************************************************
#ecpyrght
#
# backup_exit_notify.sh
#
# This script is called by the NetBackup scheduler, after an individual
# client backup has completed (including media closure and image db validation.
#
# NOTE: this script will always be run in "background" mode, meaning that
# the NetBackup scheduler will NOT wait for it's completion.
#
# This script:
# receives 7 parameters:
# CLIENT - the client hostname
# POLICY - the policy label
# SCHEDULE - the schedule label
# SCHEDULE_TYPE - the type of schedule: FULL INCR UBAK UARC
# STATUS - the backup status for this job
# STREAM - the backup stream number for this job
# DONE_TRYING - 0=will retry, 1=done, will not retry.
# must be executable by the root user
# should exit with 0 upon successful completion
OUTF=/usr/openv/netbackup/bin/BACKUP_EXIT_CALLED
# --------------------------------------------------------------------
# main script starts here
# --------------------------------------------------------------------
umask 022
dateStr=`date`
if [ "$#" -lt 7 ]
then
echo ${dateStr} "backup_exit_notify expects at least 6 parameters: $*" >> $OUTF
exit 1
fi
# You may want to delete the output file elsewhere in order to
# accumulate successful backup information.
# If so, comment out the following 4 lines.
if [ -s $OUTF ]
then
/bin/rm -rf $OUTF
fi
if [ ! -f $OUTF ]
then
touch $OUTF
fi
echo ${dateStr} "-----------------------------" >> $OUTF
echo ${dateStr} " CLIENT: $1" >> $OUTF
echo ${dateStr} " POLICY: $2" >> $OUTF
echo ${dateStr} " SCHEDULE: $3" >> $OUTF
echo ${dateStr} "SCHEDULE TYPE: $4" >> $OUTF
echo ${dateStr} " STATUS: $5" >> $OUTF
echo ${dateStr} " STREAM: $6" >> $OUTF
echo ${dateStr} " DONE_TRYING: $7" >> $OUTF
echo ${dateStr} "-----------------------------" >> $OUTF
#
# might want to mail this info to someone
#
date=`date`
cat /usr/openv/netbackup/scripts/Report/critical_policy_list |grep -i $2
if [[ $? -eq 0 && $5 -gt 1 && $5 -ne 150 ]];then
echo "Backup failed for $2" >>/usr/openv/netbackup/scripts/Report/Critical_Backup_Failures
fi
# cat $OUTF | mail -s "NetBackup backup exit" someone_who_cares
exit 0