customizing notification script
Dear All
Here i am creating notification script in NBU 7.5.0.4 & clients ( 7.5 .0.X -- 6.5.0.4 )
As per user requirement he need some more detailed information like start / end time file list etc. (which i can retrieve by parsing bpimagelist -l) on backup completion or abort
but i am not sure were i can i marge this logic since not aware which notification script is generating below mail
below is the notification mail
Backup on client enetdbbcp for user root by server SF440 succeeded.
Policy = BCP_D_W_M_enetdbbcp
Schedule = BCP_D_enetdbbcp
File list
---------
G:/dbbackup
How i configure
Host Properties > client > Properties > Universal setting > administrator > server send mail & i started receiving notification mail.
if any one help me out to find which notification script generate this mail so i can customized this script & append my required logic on successful exit
for more information
For eg.
bpimagelist -client enetdbbcp -hoursago 24 | grep -i Image | awk '{print $2,"\t\t",$7,"\t\t",$20}' etc ...
Thanks .
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