Hi everyone. I’m going to jump right in to my first post (the main reason for starting this blog in the first place) and show you the progress I’ve made with automating daily reports using our backup solution of choice, Symantec (used to be Veritas) Netbackup.
Until now our users have demanded daily reports to be emailed out to key individuals. The format of these emails was quite basic in theory…it simply showed a list of all servers (clients) that were backed up, their status from last night (e.g. successful, failed, etc…) but then, crucially, a list of files that had been skipped.
The reason for listing each file that had failed was due to Netbackup’s poor poor (don’t get me started on how poor) feedback in the Activity Monitor and it’s built in reports. You see sometimes jobs could be marked as “Successful with warnings” if the job completed but the odd file had been skipped (if it were in use, for example). But other times, although it still listed which files had been missed if you double-clicked on each job, it showed the overall status as Successful. This meant that to report on the servers in the format that was required by our users we had to manually trawl through the 360 jobs across two Netbackup servers just to copy and paste the lines of the files that had been missed.
Needless to say it didn’t take me long to get bored of this so I started looking at a way of reproducing our reports automatically. After some time, I’ve come up with a solution – it uses VBScript to parse the logs files which I output using a few key Netbackup command-line tools.
The basic process and components to the script are as follows…
- A VBscript calls a number of external batch scripts
- These batch script run NBU commands and spit their output to text files
- The VBscript then reads these text files
- The VBscript reads a servers.txt file to determine what jobs to report on*
- A LOT of array and string manipulation is used to catalogue which jobs have run and which have errors and if so, it collates all skipped files
- These arrays are then parsed and dumped to either an HTML file (which can be used directly in the body of an email) or, as I’ve recently changed to script, outputs to an Excel file.
There are some nice bits to the script(s) and some really nasty bits – I welcome you to improve on the original and share it with everyone (for example, I know there is a much neater way of calling and parsing the output of batch jobs rather than the nasty wscript.sleep I have used).
* A text file (called servers.txt) is kept along side the scripts. This file is manually edited and must be kept up to date. The file is a number of lines, each one representing a client/job that we wish to report on. The format is as follows:
60, myserver, mypolicy, GroupName
The number at the start represents what days of the week the report should be generated. myserver is obviously the client that is to be reported on. mypolicy is the name of a policy that you are reporting on (since a client may me a member of multiple policies). Finally, GroupName is free text and can be used to group similar clients (that may not necessarily be grouped by the same policy.
The scripts necessary to generate a report are…
- generateReport.vbs
The primary script which calls the others and also performs of the processing and HTML/Excel generation - jobs_summary.bat
Issues the bpdjobs – simmary command and pipes output to a text file. This provides a simple overview of number of total jobs and the number that have succeeded, failed or errored. - jobs_report.bat
This is the main batch script upon which the report is generated. It is a hideous mess of space-formatted garbage and why so much processing is needed to generate a useful and nice looking report.
Clicking the scripts above will take you to a separate page with the code and more explanations of how to use it in your environment.
UPDATE: Okay, so enough of you have expressed an interest that I decided to put it up for public download. Please note that it is not currently protected via any kind of license so please use your discretion. I have included a very basic READ ME that I encourage you to go through. Post your comments here if you have any problems.
Download: Dave’s Netbackup Reporting script

Hello David,
Could you please send me a copy of your generateReport.vbs script?
You mentioned some lines may be cut off.
If I happen to enhance anything while playing around with it, I will send you what I did.
Thanks!
Martin
Hi Martin – I’ve emailed you a copy of the whole thing…let me know how you get it. I’m sure it will need some modifying to work in your current environment. I’ve just redeployed it at my new job and it needed 10-15 mins work to get it up and running. Let me know how you get on.
Hey David,
Awesome script! I was wondering if you could e-mail me a copy so I can play with it in my environment. I’ve ran into the issue you described several times with Netbackup reporting successful but when it came time to restore, not so much.
Thanks!
Hi Aaron – check your email
Hello David,
Could you please send me a copy of the generateReport.vbs script? I have been looking for a script like this for a while.
Thanks
Please provide me the below mentioned script files……
Its matching my requiremet…
1. generateReport.vbs
The primary script which calls the others and also performs of the processing and HTML/Excel generation
2. jobs_summary.bat
Issues the bpdjobs – simmary command and pipes output to a text file. This provides a simple overview of number of total jobs and the number that have succeeded, failed or errored.
3. jobs_report.bat
This is the main batch script upon which the report is generated. It is a hideous mess of space-formatted garbage and why so much processing is needed to generate a useful and nice looking report.
You should put a link to an archive of the script(s), because I’d like to get a copy but don’t want you to keep having to do it this way…
Well since you ask so nicely…
Please consider donating if you find this useful or use it in an Enterprise environment.
Hey David,
Nice Work… If possible, could you please send me a copy of the script.. Will be a great favour ..
Thanks
Gaurav
Hi Gaurav,
Check my recent post – I’ve put a link up. Please consider donating if you find this useful or use it in an Enterprise environment.
Thanks – Dave.
Hi David,
I’m unable to find the link.
[...] placed the scripts in a public DropBox location which is linked to at the bottom of the original Netbackup Report Scripting post. In the mean time, please see the PayPal donation button to the right now. If you’ve [...]