Per Mariannes reply, many moons ago I put together a script mainly to pull off details of any jobs that failed overnight, but as you can see from the $BPERROR variable usage the script can be changed to pick up any jobs depending upon their status code (e.g. >=0 would give all jobs). Output will also include if a job failed & then re-ran & completed successfully.
BPERROR=/opt/openv/netbackup/bin/admincmd/bperror ; export BPERROR
$BPERROR -backstat -U| awk '($1 >= 0) {print $0}'|cut -c8-20|grep -v CLIENT|sort -u > failed_clients
#$BPERROR -backstat -U| awk '($1 > 0) {print $0}'|cut -c8-20|grep -v CLIENT|sort -u > failed_clients
#$BPERROR -backstat -U| awk '($1 > 1) {print $0}'|cut -c8-20|grep -v CLIENT|sort -u > failed_clients
cd /app/site/scripts
if [ ! -s /app/site/scripts/failed_clients ]
then
echo "No clients have had any failed jobs in the last 24 hours"
rm failed_clients
exit
fi
echo "The following clients have had one or more failed jobs in the last 24 hours"
echo "***************************************************************************"
echo
cat failed_clients|
while read CLIENT
do
echo
echo "JOBS RUN FOR CLIENT $CLIENT"
echo "*********************************"
$BPERROR -backstat -client $CLIENT| cut -d " " -f6 | sort -u > failed_jobid
cat failed_jobid|
while read JOB_ID
do
echo
echo "JOB_ID $JOB_ID"
$BPERROR -backstat -U -jobid $JOB_ID
done
done
rm failed_clients
rm failed_jobid
& you would get similar output to the following:
The following clients have had one or more failed jobs in the last 24 hours
***************************************************************************
JOBS RUN FOR CLIENT cream
*********************************
JOB_ID 1288562
STATUS CLIENT POLICY SCHED SERVER TIME COMPLETED
0 cream Catalog_Backup_D Daily_FULL cream 01/30/2018 01:24:09
JOB_ID 1288564
STATUS CLIENT POLICY SCHED SERVER TIME COMPLETED
0 cream Catalog_Backup_D Daily_FULL cream 01/30/2018 01:06:29
JOB_ID 1288565
STATUS CLIENT POLICY SCHED SERVER TIME COMPLETED
2074 cream Catalog_Backup_D Daily_FULL cream 01/30/2018 01:06:40
(Disk volume is down)
0 cream Catalog_Backup_D Daily_FULL cream 01/30/2018 01:24:07