Veritas-bu

[Veritas-bu] How to configure NetBackup to send email notific ation only when a job fails

2002-04-02 10:41:47
Subject: [Veritas-bu] How to configure NetBackup to send email notific ation only when a job fails
From: Mark.Donaldson AT experianems DOT com (Donaldson, Mark)
Date: Tue, 2 Apr 2002 08:41:47 -0700
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C1DA5C.E6376140
Content-Type: text/plain;
        charset="ISO-8859-1"

I do it with a script saved as .../netbackup/bin/backup_exit_notify.  The
status of the backup job is command-line paramater number five.  I just send
mail if the status code is not zero or one.  It looks like this:

#!/bin/sh
#
# This script:
#       receives 5 parameters:
#         CLIENT           - the client hostname
#         CLASS            - the class 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
#       must be executable by the root user
#       should exit with 0 upon successful completion

LOGFILE=/usr/openv/netbackup/logs/history.log
MAILADDR=YOU AT DOMAIN DOT COM

PATH=$PATH:/usr/openv/netbackup/bin/admincmd
export PATH

       CLIENT=$1
        CLASS=$2
     SCHEDULE=$3
SCHEDULE_TYPE=$4
       STATUS=$5
       STREAM=$6

shortname=`echo $CLIENT| cut -f1-2 -d'.'`
subjectline="RC=$STATUS $CLASS:$SCHEDULE $shortname"

if [ $STATUS -ne 0 -a $STATUS -ne 1 ]
then
  mailx -s "$subjectline" $MAILADDR <<-EOF
      Date=`date`
    Client=$CLIENT
     Class=$CLASS
  Schedule=$SCHEDULE
Sched type=$SCHEDULE_TYPE
    Status=$STATUS
    Stream=$STREAM

Error Description:
`bperror -S $STATUS -r`

Environment Variables:
`env`
EOF
fi
exit

-----Original Message-----
From: Conner, Neil [mailto:neil AT mbari DOT org]
Sent: Monday, April 01, 2002 5:38 PM
To: Veritas Netbackup Mailing List (E-mail)
Subject: [Veritas-bu] How to configure NetBackup to send email
notification only when a job fails


I'm running v3.4 on Solaris 8.  There is a KB article that describes how to
configure NetBackup to send email notification only when a job fails, but it
only applies to Windows platforms (245217).  Does anybody know how to do it
on Solaris?

Thanks,
Neil
_______________________________________________
Veritas-bu maillist  -  Veritas-bu AT mailman.eng.auburn DOT edu
http://mailman.eng.auburn.edu/mailman/listinfo/veritas-bu

------_=_NextPart_001_01C1DA5C.E6376140
Content-Type: text/html;
        charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3DISO-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2653.12">
<TITLE>RE: [Veritas-bu] How to configure NetBackup to send email =
notification only when a job fails</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=3D2>I do it with a script saved as =
.../netbackup/bin/backup_exit_notify.&nbsp; The status of the backup =
job is command-line paramater number five.&nbsp; I just send mail if =
the status code is not zero or one.&nbsp; It looks like =
this:</FONT></P>

<P><FONT SIZE=3D2>#!/bin/sh</FONT>
<BR><FONT SIZE=3D2>#</FONT>
<BR><FONT SIZE=3D2># This script:</FONT>
<BR><FONT SIZE=3D2>#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; receives 5 =
parameters:</FONT>
<BR><FONT SIZE=3D2>#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
CLIENT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - =
the client hostname</FONT>
<BR><FONT SIZE=3D2>#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
CLASS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
- the class label</FONT>
<BR><FONT SIZE=3D2>#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
SCHEDULE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - the schedule =
label</FONT>
<BR><FONT SIZE=3D2>#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
SCHEDULE_TYPE&nbsp;&nbsp;&nbsp; - the type of schedule:&nbsp; FULL INCR =
UBAK UARC</FONT>
<BR><FONT SIZE=3D2>#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
STATUS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - =
the backup status for this job</FONT>
<BR><FONT SIZE=3D2>#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
STREAM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - =
the backup stream number for this job</FONT>
<BR><FONT SIZE=3D2>#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; must be =
executable by the root user</FONT>
<BR><FONT SIZE=3D2>#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; should exit =
with 0 upon successful completion</FONT>
</P>

<P><FONT =
SIZE=3D2>LOGFILE=3D/usr/openv/netbackup/logs/history.log</FONT>
<BR><FONT SIZE=3D2>MAILADDR=3DYOU AT DOMAIN DOT COM</FONT>
</P>

<P><FONT SIZE=3D2>PATH=3D$PATH:/usr/openv/netbackup/bin/admincmd</FONT>
<BR><FONT SIZE=3D2>export PATH</FONT>
</P>

<P><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
CLIENT=3D$1</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
CLASS=3D$2</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp; SCHEDULE=3D$3</FONT>
<BR><FONT SIZE=3D2>SCHEDULE_TYPE=3D$4</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
STATUS=3D$5</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
STREAM=3D$6</FONT>
</P>

<P><FONT SIZE=3D2>shortname=3D`echo $CLIENT| cut -f1-2 -d'.'`</FONT>
<BR><FONT SIZE=3D2>subjectline=3D&quot;RC=3D$STATUS $CLASS:$SCHEDULE =
$shortname&quot;</FONT>
</P>

<P><FONT SIZE=3D2>if [ $STATUS -ne 0 -a $STATUS -ne 1 ]</FONT>
<BR><FONT SIZE=3D2>then</FONT>
<BR><FONT SIZE=3D2>&nbsp; mailx -s &quot;$subjectline&quot; $MAILADDR =
&lt;&lt;-EOF</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Date=3D`date`</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp; Client=3D$CLIENT</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp; Class=3D$CLASS</FONT>
<BR><FONT SIZE=3D2>&nbsp; Schedule=3D$SCHEDULE</FONT>
<BR><FONT SIZE=3D2>Sched type=3D$SCHEDULE_TYPE</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp; Status=3D$STATUS</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp; Stream=3D$STREAM</FONT>
</P>

<P><FONT SIZE=3D2>Error Description:</FONT>
<BR><FONT SIZE=3D2>`bperror -S $STATUS -r`</FONT>
</P>

<P><FONT SIZE=3D2>Environment Variables:</FONT>
<BR><FONT SIZE=3D2>`env`</FONT>
<BR><FONT SIZE=3D2>EOF</FONT>
<BR><FONT SIZE=3D2>fi</FONT>
<BR><FONT SIZE=3D2>exit</FONT>
</P>

<P><FONT SIZE=3D2>-----Original Message-----</FONT>
<BR><FONT SIZE=3D2>From: Conner, Neil [<A =
HREF=3D"mailto:neil AT mbari DOT org">mailto:neil AT mbari DOT org</A>]</FONT>
<BR><FONT SIZE=3D2>Sent: Monday, April 01, 2002 5:38 PM</FONT>
<BR><FONT SIZE=3D2>To: Veritas Netbackup Mailing List (E-mail)</FONT>
<BR><FONT SIZE=3D2>Subject: [Veritas-bu] How to configure NetBackup to =
send email</FONT>
<BR><FONT SIZE=3D2>notification only when a job fails</FONT>
</P>
<BR>

<P><FONT SIZE=3D2>I'm running v3.4 on Solaris 8.&nbsp; There is a KB =
article that describes how to configure NetBackup to send email =
notification only when a job fails, but it only applies to Windows =
platforms (245217).&nbsp; Does anybody know how to do it on =
Solaris?</FONT></P>

<P><FONT SIZE=3D2>Thanks,</FONT>
<BR><FONT SIZE=3D2>Neil</FONT>
<BR><FONT =
SIZE=3D2>_______________________________________________</FONT>
<BR><FONT SIZE=3D2>Veritas-bu maillist&nbsp; -&nbsp; =
Veritas-bu AT mailman.eng.auburn DOT edu</FONT>
<BR><FONT SIZE=3D2><A =
HREF=3D"http://mailman.eng.auburn.edu/mailman/listinfo/veritas-bu"; =
TARGET=3D"_blank">http://mailman.eng.auburn.edu/mailman/listinfo/veritas=
-bu</A></FONT>
</P>

</BODY>
</HTML>
------_=_NextPart_001_01C1DA5C.E6376140--

<Prev in Thread] Current Thread [Next in Thread>
  • [Veritas-bu] How to configure NetBackup to send email notific ation only when a job fails, Donaldson, Mark <=