How to configure email notification and the different methods to email backup exit statuses from a UNIX or Linux master in NetBackup

Article: 100016386
Last Published: 2014-07-08
Ratings: 2 0
Product(s): NetBackup & Alta Data Protection

Description

How to configure email notification and the different methods to email backup exit statuses from a UNIX or Linux master in NetBackup

The following are the different methods that can be configured to send emails for backup statuses on a UNIX master server. Each section lists when email will be sent along with how to configure it. There is also an example of the log file entries that be searched for to verify the option is working. Review each of these options and select the method that is most appropriate for the NetBackup environment.

 

I. Global Attributes -- Email only non-zero backup statuses for all clients

The Global Attributes for the master server in the GUI can be configured to send email for any non-zero backup status. The exceptions to this are status 96, 219, or any exit status where the bpbrm daemon never starts. The bpbrm daemon on the master or media server (specifically the NetBackup server where bpbrm runs for the backup in question) is what sends the actual email when this option is configured.  This option is also available on Windows servers and clients.

To set this option via the Java Administration Console:

  1. Go to Host Properties | Master Servers in the GUI
  2. Select the master server and double-click on it until the Properties window opens
  3. Go to the Global Attributes section
  4. Under Administrator e-mail address enter the email address to use

To set this option via the command line:

# cd /usr/openv/netbackup/bin/admincmd

# ./bpconfig -ma <email_address>

On the media server, a debug level (VERBOSE = 5) bpbrm log will show an entry similar to:

00:02:28.614 [25398] <2> OpenMailPipe: /usr/ucb/mail -s "Backup on client - 54 started" user@domain.com >/dev/null 2>/dev/null

Note: To configure multiple email addresses, either configure a mail alias in /etc/aliases or separate the email addresses with a comma and no space. For additional information on setting an email alias, refer to article 100000521, found below, in the Related Articles section.

 

II. Universal Settings -- Email all backup statuses for a single client

The Universal Settings for a client can be configured to send email for all backup statuses for a single client. This option must be set individually on each client you want to receive email for. You can configure this to send mail from the master (or media server, wherever bpbrm is running) or the client (which uses bpcd). The default in Universal Settings is for the client to send email. This requires that the client already be configured to send mail through a valid SMTP server. This option is also available on Windows servers and clients.

To set this option via the Java Administration Console:

  1. Go to Host Properties | Clients in the GUI
  2. Select the client and double click on it until the Properties window opens
  3. Go to the Universal Settings section
  4. Select Server sends mail if you want the master/media server to send the email
    • Or...
      Select Client sends mail if you want the Client to send the email
  5. Under Client administrator's E-mail enter the email address to use

To set this option via the command line:

  1. On the client, edit the /usr/openv/netbackup/bp.conf
  2. Add an entry SERVER_SENDS_MAIL = YES if you want the master or media server to send the email
    • Or...
      Add an entry SERVER_SENDS_MAIL = NO if you want the client to send the email
  3. Add a USEMAIL entry with the email address you want to use
    • Syntax:
      USEMAIL = <email_address>

On the media server, a debug level (VERBOSE = 5) bpbrm log will show an entry similar to:

00:02:28.614 [25398] <2> OpenMailPipe: /usr/ucb/mail -s "Backup on client - 0 started" user@domain.com >/dev/null 2>/dev/null

On the client, a debug level (VERBOSE = 5) bpcd log will show an entry similar to:

19:10:12.484 [11229] <2> OpenMailPipe: /usr/ucb/mail -s "Backup on client - 0 started" user@domain.com >/dev/null 2>/dev/null

Note: To configure multiple email addresses, either configure a mail alias in /etc/aliases or separate the email addresses with a comma and no space.

 

III. backup_exit_notify -- A script that gets called by nbpem at the end of every backup job on the master

The /usr/openv/netbackup/bin/backup_exit_notify script is called by nbpem at the end of every backup on the master server. This script can be configured to send email for status 96, 219,  and other statuses that the Global Attributes or Universal setting miss. At the end of the backup, the backup_exit_notify script is passed six variables:

$1 -- The client hostname.
$2 -- The policy name.
$3 -- The schedule name.
$4 -- The type of schedule: FULL, INCR, UBAK, UARC
$5 -- The backup status for the job.
$6 -- The backup stream number for the job.

By default, the script will write this information to /usr/openv/netbackup/bin/BACKUP_EXIT_CALLED. This script can be customized to send mail based on any of the variables passed to the script. The nbpem daemon passes the script six variables and does no checking to see if the script runs successfully. To test, simply run the backup_exit_notify and pass it six options (client, policy, schedule, type, status, stream number).

Note: Customizing this script is not supported by NetBackup Technical support. An example of the /usr/openv/netbackup/bin/backup_exit_notify script is provided as part of the default installation on the master server and can be used as a reference to customize the script.

 

IV. bpend_notify -- A script that gets called by bpbkar at the end of every backup job on the client

The /usr/openv/netbackup/bin/bpend_notify script can be created on a client and modified to send email at the end of a backup. The last step that bpbkar will do is to run the bpend_notify script if it exists. The bpend_notify script is passed five variables.

$1 -- The client hostname.
$2 -- The policy name.
$3 -- The schedule name.
$4 -- The type of schedule: FULL, INCR, UBAK, UARC
$5 -- The backup status for the job.

On the client, a debug level (VERBOSE = 5) bpbkar log will show an entry similar to:

00:45:30.143 [26370] <4> bpbkar notify: /usr/openv/netbackup/bin/bpend_notify client policy sched FULL 0

The bpbkar daemon on the client passes the script five variables. The bpbkar daemon does check to see if the script exits successfully. A backup job can exit with a status 75 if the bpend_notify script takes longer than BPEND_TIMEOUT seconds to run.

Note: Customizing this script is not supported by NetBackup Technical support.  The scripts in the goodies directory are not officially supported but are intended as examples that you can customize according to your needs.  An example of the /usr/openv/netbackup/bin/goodies/bpend_notify script is provided as part of the default installation on a NetBackup server. The bpend_notify script can be copied to the client and then customized.

 

V. mail_bp_reports -- A script in /usr/openv/netbackup/bin/goodies to mail reports

The /usr/openv/netbackup/bin/goodies/mail_bp_reports script can be used by an administrator as a convenient way to mail the various NetBackup reports. It may be used in a crontab entry to have status mailed to you once or more per day. By default, this script is configured to send an email for the backup status, problem status, and cleaning status to root on the local system. This script can be modified to email these and other reports to other administrators as well.

The script will send an email called NetBackup backup status. This email will contain the output of the following command:

# bperror -U -backstat -hoursago 24

The script will also send an email called NetBackup problems log. This email will contain the output of the command:

# bpimagelist -A -media -hoursago 24

The script will also send an email called NetBackup cleaning stats. This email will contain the output of the command:

# /usr/openv/netbackup/bin/goodies/cleanstats

Note: Customizing this script is not supported by NetBackup Technical support. The scripts in the goodies directory are not officially supported but are intended as examples that you can customize according to your needs. An example of the /usr/openv/netbackup/bin/goodies/mail_bp_reports script is provided as part of the default installation on the master server and can be used as a reference to customize the script.

Was this content helpful?