cancel
Showing results for 
Search instead for 
Did you mean: 

Sending Emails

alhamad
Level 3
How to configure NetBackup 6.0 MP5 to send email of successfully and failed backup jobs?
6 REPLIES 6

ruffy
Level 4
selam alhamad

i do it so:

use blat.exe for sending mails. documentation you can find on the net.

the modify the nbmail.cmd:

remove "@REM" in this line: "blat %3 -s %2 -t %1 -i NetBackup -server "ip-adress of your mail-server" -q"

that its!

good luck

alhamad
Level 3
Hi ruffy,
 
I tried your sugesstion and I'm able to send emails using blat, however, netbackup still does not send any. Here is my nbmail.cmd and backup_end_notify.cmd. Please help.
 
@REM $Header: nbmail.cmd,v 1.8 2005/05/10 16:12:29 $
@REM
@REM bcpyrght
@REM ***************************************************************************
@REM * $VRTScprght: Copyright 1993 - 2006 Symantec Corporation, All Rights Reserved $ *
@REM ***************************************************************************
@REM ecpyrght
@REM
@REM - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@REM -                                                                         -
@REM - HOW TO SEND MAIL FROM THE NT NETBACKUP SERVER                           -
@REM -                                                                         -
@REM - NetBackup checks if the mail script (NetBackup\Bin\nbmail.cmd) exists.  -
@REM - If the script exists, NetBackup runs it passing four parameters on the  -
@REM - command line:                                                       -
@REM -                                                                         -
@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 -                                                                         -
@REM - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@REM -                                                                         -
@REM - HOW TO SEND DR MAIL FROM THE NT NETBACKUP SERVER                        -
@REM -                                                                         -
@REM - NetBackup DR protection checks if the mail script                       -
@REM - (NetBackup\Bin\mail_dr_info.cmd) exists.  If the script exists          -
@REM - NetBackup DR protection runs it passing four parameters on the          -
@REM - command line:                                                           -
@REM -                                                                         -
@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 -                                                                         -
@REM - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@REM -                                                                         -
@REM - A public domain SMTP mail client for NT called BLAT is available at:    -
@REM -                                                                         -
@REM -                       http://blat.net/                                  -
@REM -                                                                         -
@REM - Here's how to use BLAT with the NetBackup NT server.                    -
@REM - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@REM
@IF "%~4"=="" (
 C:\blat262\full\blat %3 -s %2 -t %1 -i NetBackup -server 192.168.54.12 -q
) ELSE (
 C:\blat262\full\blat %3 -s %2 -t %1 -i NetBackup -server 192.168.54.12 -q -attach %4
)
@REM
@REM - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@REM - The -i option designates the originator's address, you may change this  -
@REM - or omit it altogether (the default is the sender's address specified    -
@REM - when BLAT was installed).                                               -
@REM -                                                                         -
@REM - The -server option is given as an example, you need to determine the    -
@REM - correct name of your SMTP server.  This option may also be omitted      -
@REM - (the default is the server specified when installing BLAT).             -
@REM -                                                                         -
@REM - You may use any mail program you want, as long as it has a command line -
@REM - interface that can be used to send mail.  Just substitute a call to     -
@REM - your favorite mail program for the call to BLAT above.                  -
@REM -                                                                         -
@REM - After modifying this script to suit your situation (make sure you are   -
@REM - calling a valid mail program and the call is not commented out),        -
@REM - activate it by moving it to the NetBackup\Bin directory.                -
@REM - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@REM - Some email servers do not handle the formating of the messages created  -
@REM - by NetBackup.  Here is an example of how to get Exchange or IIS to      -
@REM - send the mail messages.             -
@REM - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@REM - @copy /y %3 %TEMP%\nbmail.tmp > NUL
@REM - @echo . >> %TEMP%\nbmail.tmp
@REM - @IF "%~4"=="" (
@REM - blat %TEMP%\nbmail.tmp -s %2 -t %1 -q
@REM - ) ELSE (
@REM - blat %TEMP%\nbmail.tmp -s %2 -t %1 -q -attach %4
@REM - )
@REM -
@REM - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 

alhamad
Level 3
@REM
@REM $Header: backup_exit_notify.cmd,v 1.2 2002/11/20 02:10:34 $
@REM
@REM bcpyrght
@REM ***************************************************************************
@REM * $VRTScprght: Copyright 1993 - 2007 Symantec Corporation, All Rights Reserved $ *
@REM ***************************************************************************
@REM ecpyrght
@REM
@REM backup_exit_notify.cmd
@REM
@REM This script is called by the NetBackup scheduler, after an individual
@REM client backup has completed (including media closure and image db
@REM validation.
@REM
@REM NOTE:  this script will always be run in "background" mode, meaning that
@REM        the NetBackup scheduler will NOT wait for it's completion.
@REM
@REM This script:
@REM receives 5 parameters:
@REM  %1 = CLIENT           - the client hostname
@REM  %2 = POLICY           - the policy label
@REM  %3 = SCHEDULE         - the schedule label
@REM  %4 = SCHEDULE_TYPE    - the type of schedule:  FULL INCR UBAK
@REM                                                 UARC
@REM  %5 = STATUS           - the backup status for this job
@REM  %6 = STREAM           - the backup stream number for this job
@REM
@REM - Main program ------------------------------------------------------------
@REM -
@REM - This script only runs on NT 4.0 and succeeding versions of NT.  You must
@REM - have command extensions enabled.  Check the following registry entry:
@REM -
@REM - HKEY_CURRENT_USER\Software\Microsoft\Command Processor\EnableExtensions
@REM -
@REM - It should be set to 0x1 or you may have problems running this script.
@REM ---------------------------------------------------------------------------
@setlocal ENABLEEXTENSIONS
@set LISTPATHS="%~dp0\goodies\listpaths"
@for /F "delims=|" %%p in ('%LISTPATHS% /s NB_MAIL_SCRIPT') do @set NB_MAIL_SCRIPT="%%p"
@set OUTF="%~dp0\BACKUP_EXIT_CALLED"
@REM ---------------------------------------------------------------------------
@REM - Get date and time.
@REM ---------------------------------------------------------------------------
@for /F "tokens=1*" %%p in ('date /T') do @set DATE=%%p %%q
@for /F %%p in ('time /T') do @set DATE=%DATE% %%p
@REM ---------------------------------------------------------------------------
@REM - Check for proper parameter use.
@REM ---------------------------------------------------------------------------
@if "%6" == "" goto BadParams
@if "%7" == "" goto GoodParams
:BadParams
@echo %DATE% backup_exit_notify expects 6 parameters: %* >> %OUTF%
@goto EndMain
:GoodParams
@REM ---------------------------------------------------------------------------
@REM - You may want to delete the output file elsewhere in order to
@REM - accumulate successful backup information.  If so, delete the
@REM - following line or move it to where it will do the most good.
@REM ---------------------------------------------------------------------------
@if exist %OUTF% del %OUTF%
@REM ---------------------------------------------------------------------------
@echo %DATE% ----------------------------- >> %OUTF%
@echo %DATE%        CLIENT:  %1 >> %OUTF%
@echo %DATE%        POLICY:  %2 >> %OUTF%
@echo %DATE%      SCHEDULE:  %3 >> %OUTF%
@echo %DATE% SCHEDULE TYPE:  %4 >> %OUTF%
@echo %DATE%        STATUS:  %5 >> %OUTF%
@echo %DATE%        STREAM:  %6 >> %OUTF%
@echo %DATE% ----------------------------- >> %OUTF%
@REM ---------------------------------------------------------------------------
@REM - might want to mail this info to someone
@REM -
@call %NB_MAIL_SCRIPT% sysnotifications@alsalambahrain.com "NetBackup backup exit" %OUTF%
@REM ---------------------------------------------------------------------------
:EndMain
@endlocal
@REM - End of Main Program -----------------------------------------------------

Stumpr2
Level 6
DOCUMENTATION: The nbmail.cmd mail notification -- a mini workshop with troubleshooting tips and details of how to get it working
 
 

alhamad
Level 3
Ok, got it working! thnks Stumpr and ruffy

Stumpr2
Level 6
Good!
Glad to hear it.