05-07-2013 05:33 PM
Hi All,
Can anybody help me to get a script to collect failed backup report on daily basis and last successful backup for the failed clients? Below are the overview of environment :
Master Server : Linux- Netbackup 7.1
Media Server (6 in no.) : AIX- Netbackup 7.1
Clients : Mostly- Netbackup 7.1
05-08-2013 03:29 AM
You should consider to deploy OpsCenter for backup reporting.
http://eval.symantec.com/mktginfo/enterprise/white_papers/b-nbu_7_opscenter_analytics_WP.en-us.pdf
http://www.symantec.com/opscenter-analytics
Opscenter is free if you have Netbackup
OpsCenter analytics is licensed.
05-13-2013 09:53 AM
Thanks Nicolai for your suggesstion. But In my backup enviornment no OpsCenter is implemented and my client need a script to collect failed jobs.
Can anyone help me in this regard ?
07-22-2013 04:22 AM
For some quick daily Reporting you might check these commands :
bperror -backstat -by_statcode -hoursago 36 -U
bperror -backstat -hoursago 36 -U|grep -v ' 0 '
bperror -backstat -hoursago 78 -U|grep <client_name> [|grep <policy_name>] [|grep <schedule_name>]
Have fun,
Ingo
07-22-2013 05:23 AM
We used the following (dirty) UNIX script on a daily basis utilising the bperror command mentioned by Flako (it does not, however, detail the last successful client backup - I'll leave that to you!) (EDIT: but you could incorporate, for each failed client, bpimagelist -U -client $CLIENT -d 12/31/12 | head -3 | tail -1 or something more appropriate to yourself?)
bperror -backstat -U| awk '($1 > 1) {print $0}'|cut -c8-20|grep -v \ CLIENT|sort -u > failed_clients 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
It *will* also report if said failed job re-started & completed successfully (using the same job_id)
(***EDIT #2: just realised OP is nearly 2 months old & no return since - hopefully managed to work something out!)
07-22-2013 05:43 AM
First i do a "bperror -backstat -hoursago 48 -U |grep -v ' 0 '"
In a script i read the client, the policy and the schedule of the failing job.
For every failing client/policy/schedule i do a
"bperror -backstat -U -hoursago ?? -client <client> | grep <policy> | grep <Schedule>"
That way i see if and when was another run of the failing job.
i.e.:
root@klnnbus1:/ :) bperror -backstat -U -hoursago 72 -client dsnklnp740-2b
STATUS CLIENT POLICY SCHED SERVER TIME COMPLETED
0 dsnklnp740-2b OS-CUM-NEW CINC_Daily dsnklnt4-2 07/19/2013 17:08:30
59 dsnklnp740-2b OS-CUM-NEW FULL_Sat dsnklnt4-2 07/20/2013 13:06:18
(access to the client was not allowed)
59 dsnklnp740-2b OS-CUM-NEW FULL_Sat dsnklnt4-2 07/20/2013 14:10:54
(access to the client was not allowed)
59 dsnklnp740-2b OS-CUM-NEW FULL_Sat dsnklnt4-2 07/20/2013 14:57:33
(access to the client was not allowed)
0 dsnklnp740-2b OS-CUM-NEW FULL_Sat dsnklnt4-2 07/22/2013 09:46:55
root@klnnbus1:/ :)
07-22-2013 06:11 AM
07-22-2013 06:17 AM
Hmmm ..... have seen jobs fail & show as failed in the Actiivity Monitor but subsequently re-start as a different job ids & succeed - that's gonna take scripting beyond my basic skills!
07-22-2013 06:55 AM
A report of "failed backup and not failed jobs" ??
Thats what parameter "-backstat" in the bperror CMD means "back(up)stat(us)" .
You dont have to mess with job ids or restarts or whatever.
Just do the
"bperror -backstat -U -hoursago ?? -client <client> | grep <policy> | grep <Schedule>"
and you get a Date Sorted List of the Backups for this client/policy/schedule.
But you are right, there may be several ways to get to a nice list. ;)