cancel
Showing results for 
Search instead for 
Did you mean: 

Custom netbackup 7.7.3 email notification

Adalberto_Blanc
Level 3
Partner

Hello,

I would like to know if it is posible to have a custom email notification from the Netbackup.

The master server is running on windows 2012 with the email notification enabled using blat email server is working now.

I would like to have a more friendly presentation from the email notification  that netbackup sends.

I have read this thechnote: https://www.veritas.com/support/en_US/article.TECH24110

 

Any other suggestion?

 

Best Regards

 

 

3 REPLIES 3

sclind
Moderator
Moderator
   VIP   

I have changed the nbmail.cmd script that is provided to call a powershell script:

@REM - %1 is the recipient's address -
@REM - %2 is the subject line -
@REM - %3 is the message file name -
@REM - %4 is the attached file name

REM call a powershell version of this script - we can do more in powershell than in cmd files
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe d:\util\scripts\nbmail.ps1 \"%1\" \"%2\" \"%3\" \"%4\"

I can then code more logic - and change the email contents - than can easily be done in a cmd file.

 

Genericus
Moderator
Moderator
   VIP   

NetBackup provides a script in the bin directory called backup_exit_notify

If you set up policy and schedule naming convention, you can use it to send emails.

# This script:
# receives 8 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.
# PRIMARY_JOBID - the jobid for this job

The script comes with these lines:

# might want to mail this info to someone
#
# cat $OUTF | mail -s "NetBackup backup exit" someone_who_cares

 I added these:

if [ $5 != 0 -a $5 != 1 -a $5 != 71 -a $5 != 150 -a $5 != 800 -a $5 != 191 -a $3 != "Child.Job" ] # do not mail on return codes 0,1,71,150,800,191 or ANY "Child.Job" (you have to name the schedule Child.Job)
then
if /usr/openv/netbackup/bin/admincmd/bppllist $2 -U | grep "Policy Type" | grep MS-Window
then
cat $OUTF | /usr/bin/mailx -s "WINDOWS NetBackup Error Status $5, Policy $2, Client $1" \
operations@company.com windows@company.com
elif /usr/openv/netbackup/bin/admincmd/bppllist $2 -U | grep "Policy Type" | grep MS-Exchange
then
cat $OUTF | /usr/bin/mailx -s "EXCHANGE NetBackup Error Status $5, Policy $2, Client $1" \
operations@company.com windows@company.com
elif /usr/openv/netbackup/bin/admincmd/bppllist $2 -U | grep "Policy Type" | grep VMWARE
then
cat $OUTF | /usr/bin/mailx -s "VMWARE NetBackup Error Status $5, Policy $2, Client $1" \
operations@company.com vmteam@company.com
elif /usr/openv/netbackup/bin/admincmd/bppllist $2 -U | grep "Policy Type" | grep MS-SQL
then
cat $OUTF | /usr/bin/mailx -s "MS-SQL NetBackup Error Status $5, Policy $2, Client $1" \
operations@company.com sqldba@company.com
elif /usr/openv/netbackup/bin/admincmd/bppllist $2 -U | grep "Policy Type" | grep Oracle
then
cat $OUTF | /usr/bin/mailx -s "ORACLE NetBackup Error Status $5, Policy $2, Client $1" \
operations@company.com oracledba@company.com
elif /usr/openv/netbackup/bin/admincmd/bppllist $2 -U | grep "Policy Type" | grep Sybase
then
cat $OUTF | /usr/bin/mailx -s "SYBASE NetBackup Error Status $5, Policy $2, Client $1" \
operations@company.com sybasedba@company.com
else
cat $OUTF | /usr/bin/mailx -s "UNIX NetBackup Error Status $5, Policy $2, Client $1" \
operations@company.com unix@company.com
fi
fi

NetBackup 8.3.0.1 on Solaris 11, writing to Data Domain 9800 6.2.1.0
duplicating via SLP to LTO5 in SL8500 via ACSLS

Marianne
Moderator
Moderator
Partner    VIP    Accredited Certified

@Adalberto_Blanc have you seen these 2 excellent attempts to help you?