customizing notification script
- 11 years ago
Dear m.karampasis,
1) Below script run on master server
This script is called by the NetBackup scheduler, after an individual client backup has completed
Path - /usr/openv/netbackup/bin/backup_exit_notify
My script (mail_notification.sh ) internally called in backup_exit_notify.sh & sends notification mail with some extra details
call mail_notification.sh on 71st line of backup_exit_notify.sh like given below
---------------------------------------------------------------
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} "PRIMARY JOBID: $8" >> $OUTF
echo ${dateStr} "-----------------------------" >> $OUTFsh /usr/local/BKP/mail_notification.sh
# might want to mail this info to someone
#
# cat $OUTF | mail -s "NetBackup backup exit" someone_who_cares
--------------------------------------------------------------------2) We have multiple master server & on one of the master I found different output for "/usr/openv/netbackup/bin/BACKUP_EXIT_CALLED" which I used to manipulate data
so check /usr/openv/netbackup/bin/BACKUP_EXIT_CALLED output in your environment & use script accordingly with minor changes.below is the list i came acrossUse mail_notification.sh-1.txt for output like below
# cat /usr/openv/netbackup/bin/BACKUP_EXIT_CALLED
Wed Jan 29 00:08:32 IST 2014 -----------------------------
Wed Jan 29 00:08:32 IST 2014 CLIENT: FLXMIDDRMQ1
Wed Jan 29 00:08:32 IST 2014 POLICY: BCP_D_W_M_FLXMIDDRMQ1
Wed Jan 29 00:08:32 IST 2014 SCHEDULE: D_FLXMIDDRMQ1
Wed Jan 29 00:08:32 IST 2014 SCHEDULE TYPE: FULL
Wed Jan 29 00:08:32 IST 2014 STATUS: 0
Wed Jan 29 00:08:32 IST 2014 STREAM: 0
Wed Jan 29 00:08:32 IST 2014 DONE_TRYING: 1
Wed Jan 29 00:08:32 IST 2014 PRIMARY JOBID: 57382
Wed Jan 29 00:08:32 IST 2014 -----------------------------
Use mail_notification.sh-2.txt for output like below# cat /usr/openv/netbackup/bin/BACKUP_EXIT_CALLED
Wednesday 29 January 2014 12:25:54 AM IST -----------------------------
Wednesday 29 January 2014 12:25:54 AM IST CLIENT: HBPRDMAIL3
Wednesday 29 January 2014 12:25:54 AM IST POLICY: DAKC_Lotus_D_M_HBPRDMAIL3
Wednesday 29 January 2014 12:25:54 AM IST SCHEDULE: D_HBPRDMAIL3
Wednesday 29 January 2014 12:25:54 AM IST SCHEDULE TYPE: FULL
Wednesday 29 January 2014 12:25:54 AM IST STATUS: 1
Wednesday 29 January 2014 12:25:54 AM IST STREAM: -1
Wednesday 29 January 2014 12:25:54 AM IST DONE_TRYING: 1
Wednesday 29 January 2014 12:25:54 AM IST PRIMARY JOBID: 347855
Wednesday 29 January 2014 12:25:54 AM IST -----------------------------
[ Note - in case you found different date string as per the OS make minor changes accordingly ]Find attached script - backup_exit_notify.sh ( eg edit existing NBU script )
mail_notification.sh-1.txt
mail_notification.sh-2.txt