Saturday, December 8, 2007

Here's a little something extra for this week that I cooked up to help me be able to get a quick glance at the previous night's NetBackup activity. It's called bpreport.pl

In a future post, we'll explore the finer points of the script. For now, feel free to enjoy the fruits of my labor ;)

This Perl script parses the output of the bpdbjobs command (with the "-all_columns") switch and converts that nasty gigantic wad of codes and unix time stamps into a presentable daily report. We list the error (or problem) jobs at the top of the email sent to us in the morning (or a nice message indicating there were no errors) and also include the details of each job's progress/completion.

Since I wrote this specifically for myself, I only report on the Server Name, Policy Name, Kb backed up, number of minutes Elapsed during the backup, the start date and time and the end date and time. Note the report_span subroutine. You can feed this any number of seconds (86400 in a day) to determine how far back you want information regarding your backups' status from this script when you run it

I hope you enjoy it, or it makes your life easier (assuming you use NetBackup for your backup software).

If you do find it useful, and make use of it, including a link back to here in your code would be nice :)