Please enter search query.
Search <product_name> all support & community content...
How to configure NetBackup on Windows to send email notification after completion of backup jobs? (success and failures)
Article: 100021865
Last Published: 2020-04-07
Ratings: 1 0
Product(s): NetBackup
Problem
How to configure NetBackup on Windows to send email notifications after completion of backup jobs? (success and failures)
Solution
NetBackup has various script files that assumes a SMTP utility called
BLAT is in place. The
nbmail.cmd script and the BLAT utility work together for successful delivery of notification emails.
BLAT is a open source utility and the most recent version of BLAT can be downloaded from this site: https://sourceforge.net/projects/blat/
Note: BLAT is a third party product. It is not written, endorsed or supported by Veritas. Any problems with BLAT should be reported to the makers of BLAT directly. Veritas will be unable to assist with issues that are encountered when installing or using BLAT.
Step 1: Installing and Configuring the BLAT executable
- Extract the downloaded zip file in a new folder. We need these 3 files within the folder called Full.
- Copy these three files to the \WINDOWS\System32 directory (On the NBU Master Server)
blat.dll
blat.exe
blat.lib
- Configure BLAT by running this command at the command prompt
blat -install <server addr> <sender's addr>
Note: "<server addr>" is the hostname or IP address of the email server that will send the email notifications.
"<sender's addr>" is the account that will be the primary sender of the email notifications.
Example:
blat -install emailserver.company.com useraccount@company.com <mailto:useraccount@company.com>
blat -install emailserver.company.com useraccount@company.com <mailto:useraccount@company.com>
- Test the installation of blat by creating a text file C:\testfile.txt with a message and emailing it to the NetBackup administrator.
Example:
blat C:\testfile.txt -to useraccount@company.com <mailto:useraccount@company.com>
- If blat is working correctly, the NetBackup administrator should receive the contents of the C:\testfile.txt file.
Step 2: Modify the nbmail.cmd script
- Open nbmail.cmd using notepad.exe or some other text editor. The file can be found on a NetBackup Master Server at <install_path>\VERITAS\NetBackup\bin. Please make a backup copy of this script before modifying it.
Note: When using Notepad to modify a script, do not use the Word Wrap option. If this option is enabled, then it will need to be unchecked. Using this option can result in extra line feeds being added to the script which will render it non-functional.
- Most of the lines in the nbmail.cmd file are informational. The following lines are what really matter.
----------------------------------------------
@IF "%~4"=="" (
blat %3 -s %2 -t %1 -i NetBackup -server emailserver.company.com -q
) ELSE (
blat %3 -s %2 -t %1 -i NetBackup -server emailserver.company.com -q -attach %4
)
-----------------------------------------------
(To avoid mistakes, simply copy-paste from above and then modify it)
@IF "%~4"=="" (
blat %3 -s %2 -t %1 -i NetBackup -server emailserver.company.com -q
) ELSE (
blat %3 -s %2 -t %1 -i NetBackup -server emailserver.company.com -q -attach %4
)
-----------------------------------------------
(To avoid mistakes, simply copy-paste from above and then modify it)
Step 3: Configuring Netbackup to use email notification.
- Under Host Properties for the master server >> Universal Settings >> Administrator e-mail address:
Provide the email address for the NetBackup administrator.
Select the option "Server sends mail"
Select the option "Server sends mail"
- Restart Netbackup Services
If a job fails to complete, an email will be sent to the administrator. Emails can also be configured for successful job completion. Please see the Administrator's Guide for additional information.
Options explained:
- %3 is the file that BLAT will send in the body of the email. This is generated by one of the other scripts, (Example: backup_notification.cmd)
- -s is the subject line of the email
- %2 is the contents of the subject line. This is generated by another script that calls on blat, (Example: backup_notification.cmd)
- -t is who will receive the email.
- %1 - is the email address. This is by default the contents of the Email Address for the administrator of this NetBackup Client field.
- -i is the "From" portion of the email. This is not necessarily known to the email server. In this case, it will be "From NetBackup." There should be a valid email address specified here instead of "NetBackup", such as "admin@acme.com".
- -server is the name of the SMTP server to use.
- -q will suppress all output to the screen