cancel
Showing results for 
Search instead for 
Did you mean: 

parent_end_notify not working with databases

sa2
Level 4

Hi ,

i have modified parent_end_notify to send me alert when parent job failed with a Full backup type  failed 

it works good with all filesystems 

but i doesn't send alert for the databases like oracle and sql

does this script only for filesystem , if yes is there any way to monitor databases backup ?

10 REPLIES 10

Tousif
Level 6

Hello

It should work for database policy type as well.

Please share the content of parent_end_notify script

There is one more option suggested in below post.

https://vox.veritas.com/t5/NetBackup/Parent-end-notify-script/td-p/691791

Thanks & Regards

Hi Tousif ,

Thanks for your reply

This is my modified  code

 

#! /bin/sh
# $Header: parent_end_notify.sh,v 1.3 2009/08/10 20:44:49 $

#bcpyrght
#***************************************************************************
#* $VRTScprght: Copyright 2014 Symantec Corporation, All Rights Reserved SY39-6648-5573-26-15-5  $ *
#***************************************************************************
#ecpyrght

#
# parent_end_notify.sh
#
# This script is called by GenBackupJob (nbjm), after the parent job has completed.
#
# NOTE:  this script will always be run in "background" mode, meaning that
#        GenBackupJob (nbjm) will NOT wait for it's completion.
#
# This script:
#       receives 7 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 always -1
#         STREAM_CNT       - # streams started (if -1, genjob failed to call pem)
#       must be executable by the root user
#       should exit with 0 upon successful completion

OUTF=/usr/openv/netbackup/bin/PARENT_END_CALLED

# --------------------------------------------------------------------
# main script starts here
# --------------------------------------------------------------------

umask 022

dateStr=`date`
if [ "$#" -lt 7 ]
then
        echo ${dateStr} "parent_end_notify expects at least 7 parameters: $*" >> $OUTF
        exit 1
fi

# You may want to delete the output file elsewhere in order to
# accumulate successful backup information.
# If so, comment out the following 4 lines.
if [ -s $OUTF ]
then
        /bin/rm -rf $OUTF
fi

if [ ! -f $OUTF ]
then
        touch $OUTF
fi

echo ${dateStr} "-----------------------------" >> $OUTF
echo ${dateStr} "       CLIENT:  $1" >> $OUTF
echo ${dateStr} "       POLICY:  $2" >> $OUTF
echo ${dateStr} "     SCHEDULE:  $3" >> $OUTF
echo ${dateStr} "SCHEDULE TYPE:  $4" >> $OUTF
echo ${dateStr} "       STATUS:  $5" >> $OUTF
echo ${dateStr} "       STREAM:  $6" >> $OUTF
echo ${dateStr} "   STREAM_CNT:  $7" >> $OUTF
echo ${dateStr} "-----------------------------" >> $OUTF

#
# might want to mail this info to someone
#
# cat $OUTF | mail -s "NetBackup parent end notify" someone_who_cares

if [ "$4" == "FULL" ]
then

if [ "$5" -ne "0" ]
then
 cat $OUTF | mail -s "NetBackup backup exit" admin@server.iti.com
fi

fi

exit 0

Hi Tousif ,

Thanks for your reply , this is my modified code

#! /bin/sh
# $Header: parent_end_notify.sh,v 1.3 2009/08/10 20:44:49 $

#bcpyrght
#***************************************************************************
#* $VRTScprght: Copyright 2014 Symantec Corporation, All Rights Reserved SY39-6648-5573-26-15-5  $ *
#***************************************************************************
#ecpyrght

#
# parent_end_notify.sh
#
# This script is called by GenBackupJob (nbjm), after the parent job has completed.
#
# NOTE:  this script will always be run in "background" mode, meaning that
#        GenBackupJob (nbjm) will NOT wait for it's completion.
#
# This script:
#       receives 7 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 always -1
#         STREAM_CNT       - # streams started (if -1, genjob failed to call pem)
#       must be executable by the root user
#       should exit with 0 upon successful completion

OUTF=/usr/openv/netbackup/bin/PARENT_END_CALLED

# --------------------------------------------------------------------
# main script starts here
# --------------------------------------------------------------------

umask 022

dateStr=`date`
if [ "$#" -lt 7 ]
then
        echo ${dateStr} "parent_end_notify expects at least 7 parameters: $*" >> $OUTF
        exit 1
fi

# You may want to delete the output file elsewhere in order to
# accumulate successful backup information.
# If so, comment out the following 4 lines.
if [ -s $OUTF ]
then
        /bin/rm -rf $OUTF
fi

if [ ! -f $OUTF ]
then
        touch $OUTF
fi

echo ${dateStr} "-----------------------------" >> $OUTF
echo ${dateStr} "       CLIENT:  $1" >> $OUTF
echo ${dateStr} "       POLICY:  $2" >> $OUTF
echo ${dateStr} "     SCHEDULE:  $3" >> $OUTF
echo ${dateStr} "SCHEDULE TYPE:  $4" >> $OUTF
echo ${dateStr} "       STATUS:  $5" >> $OUTF
echo ${dateStr} "       STREAM:  $6" >> $OUTF
echo ${dateStr} "   STREAM_CNT:  $7" >> $OUTF
echo ${dateStr} "-----------------------------" >> $OUTF

#
# might want to mail this info to someone
#
# cat $OUTF | mail -s "NetBackup parent end notify" someone_who_cares

if [ "$4" == "FULL" ]
then

if [ "$5" -ne "0" ]
then
 cat $OUTF | mail -s "NetBackup backup exit" admin@server.mysite.com
fi

fi

exit 0

Thanks Tousif for your reply , this is  my modified code

#! /bin/sh
# $Header: parent_end_notify.sh,v 1.3 2009/08/10 20:44:49 $

#bcpyrght
#***************************************************************************
#* $VRTScprght: Copyright 2014 Symantec Corporation, All Rights Reserved SY39-6648-5573-26-15-5  $ *
#***************************************************************************
#ecpyrght

#
# parent_end_notify.sh
#
# This script is called by GenBackupJob (nbjm), after the parent job has completed.
#
# NOTE:  this script will always be run in "background" mode, meaning that
#        GenBackupJob (nbjm) will NOT wait for it's completion.
#
# This script:
#       receives 7 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 always -1
#         STREAM_CNT       - # streams started (if -1, genjob failed to call pem)
#       must be executable by the root user
#       should exit with 0 upon successful completion

OUTF=/usr/openv/netbackup/bin/PARENT_END_CALLED

# --------------------------------------------------------------------
# main script starts here
# --------------------------------------------------------------------

umask 022

dateStr=`date`
if [ "$#" -lt 7 ]
then
        echo ${dateStr} "parent_end_notify expects at least 7 parameters: $*" >> $OUTF
        exit 1
fi

# You may want to delete the output file elsewhere in order to
# accumulate successful backup information.
# If so, comment out the following 4 lines.
if [ -s $OUTF ]
then
        /bin/rm -rf $OUTF
fi

if [ ! -f $OUTF ]
then
        touch $OUTF
fi

echo ${dateStr} "-----------------------------" >> $OUTF
echo ${dateStr} "       CLIENT:  $1" >> $OUTF
echo ${dateStr} "       POLICY:  $2" >> $OUTF
echo ${dateStr} "     SCHEDULE:  $3" >> $OUTF
echo ${dateStr} "SCHEDULE TYPE:  $4" >> $OUTF
echo ${dateStr} "       STATUS:  $5" >> $OUTF
echo ${dateStr} "       STREAM:  $6" >> $OUTF
echo ${dateStr} "   STREAM_CNT:  $7" >> $OUTF
echo ${dateStr} "-----------------------------" >> $OUTF

#
# might want to mail this info to someone
#
# cat $OUTF | mail -s "NetBackup parent end notify" someone_who_cares

if [ "$4" == "FULL" ]
then

if [ "$5" -ne "0" ]
then
 cat $OUTF | mail -s "NetBackup backup exit" admin@server.mysite.com
fi

fi

exit 0

sa2
Level 4

Thanks for your reply , this is the modified code 

#! /bin/sh
# $Header: parent_end_notify.sh,v 1.3 2009/08/10 20:44:49 $

#bcpyrght
#***************************************************************************
#* $VRTScprght: Copyright 2014 Symantec Corporation, All Rights Reserved SY39-6648-5573-26-15-5  $ *
#***************************************************************************
#ecpyrght

#
# parent_end_notify.sh
#
# This script is called by GenBackupJob (nbjm), after the parent job has completed.
#
# NOTE:  this script will always be run in "background" mode, meaning that
#        GenBackupJob (nbjm) will NOT wait for it's completion.
#
# This script:
#       receives 7 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 always -1
#         STREAM_CNT       - # streams started (if -1, genjob failed to call pem)
#       must be executable by the root user
#       should exit with 0 upon successful completion

OUTF=/usr/openv/netbackup/bin/PARENT_END_CALLED

# --------------------------------------------------------------------
# main script starts here
# --------------------------------------------------------------------

umask 022

dateStr=`date`
if [ "$#" -lt 7 ]
then
        echo ${dateStr} "parent_end_notify expects at least 7 parameters: $*" >> $OUTF
        exit 1
fi

# You may want to delete the output file elsewhere in order to
# accumulate successful backup information.
# If so, comment out the following 4 lines.
if [ -s $OUTF ]
then
        /bin/rm -rf $OUTF
fi

if [ ! -f $OUTF ]
then
        touch $OUTF
fi

echo ${dateStr} "-----------------------------" >> $OUTF
echo ${dateStr} "       CLIENT:  $1" >> $OUTF
echo ${dateStr} "       POLICY:  $2" >> $OUTF
echo ${dateStr} "     SCHEDULE:  $3" >> $OUTF
echo ${dateStr} "SCHEDULE TYPE:  $4" >> $OUTF
echo ${dateStr} "       STATUS:  $5" >> $OUTF
echo ${dateStr} "       STREAM:  $6" >> $OUTF
echo ${dateStr} "   STREAM_CNT:  $7" >> $OUTF
echo ${dateStr} "-----------------------------" >> $OUTF

#
# might want to mail this info to someone
#
# cat $OUTF | mail -s "NetBackup parent end notify" someone_who_cares

if [ "$4" == "FULL" ]
then

if [ "$5" -ne "0" ]
then
 cat $OUTF | mail -s "NetBackup backup exit" admin@server.testsite.com
fi

fi

exit 0

Hello,

 

What schedule type are you getting in NBU activity monitor for database Parent Job?

In script it only mentioned "FULL" schedule type".

if [ "$4" == "FULL" ]

 

Thanks & Regards,

 

 

yes i need to be notified with only failed jobs with type full does the problem may be due to Full , is it different keyword for databases ??

Marianne
Level 6
Partner    VIP    Accredited Certified
What is the schedule type for the db parent job(s)?

Full backup

Marianne
Level 6
Partner    VIP    Accredited Certified
Please post policy config for one of your db policies:
bppllist (policy-name) -U