1820693 Members
2878 Online
109627 Solutions
New Discussion юеВ

NetBackup Status Script

 
SOLVED
Go to solution
James Bagdtem
Occasional Advisor

NetBackup Status Script

Hello Everyone

I have script that is run via cron to execute a backup. What I also want to do now is have another script that I can run at the end of the first one that grabs all the backup information using a command such as bperror or whatever and emails it to me. I need to know:

* Server name
* Date
* Start time
* End time
* Size or amount of data written
* Status (exit code number)
* Transfer rate (kbps) - Optional

If anyone has a script they which produces all of the above info it would be greatly appreciated if you could share it!! Lots of points for good scripts!

NetBackup server version is 3.4GA

Thanks

James
12 REPLIES 12
James Perry
Advisor

Re: NetBackup Status Script

James,
Take a look at the bpend_notify script in the /usr/openv/netbackup/bin/goodies directory. It will provide the client name, class name, schedule, and status.
The bpend_notify gets passed CLIENTNAME CLASSNAME SCHEDNAME SCHEDTYPE STATUS from bpbkar. If you were write a bpend_notify script in perl, you could easily pass the CLIENTNAME, CLASSNAME, and SCHEDNAME to bpimage. It will provide a raw output with the lines IMAGE, HISTO, and FLAG. Field 13 is the start time, field 14 was how many seconds the backup ran, and field 18 is the number of KB backed up. I compute the transfer rate by (field 18 / field 14) / 1024 to get MB/s speed.
You should be able to write this in perl or the script language of your choice. The script that I have is in perl, but it generates .csv files for Excel and pulls the information for 2 weeks of backups on all servers.
Ed Mitchell_1
Advisor

Re: NetBackup Status Script

See attached. It will get you started in the right direction.

mr ed
if it ain't broke, don't patch it.
Dave La Mar
Honored Contributor
Solution

Re: NetBackup Status Script

James -
Attached is a script that we run each morning via cron to give us the nightly backup status for all jobs.
Most of the script came from a post in the forum and was hacked to accomodate our shop.
Also attached is a sample of the report output that is emailed.

.xbpmonrcdl is the file with the parm settings from activity monitor and should be set according to your needs, or I can send our file if you desire.

Best of luck.

Regards,
dl
"I'm not dumb. I just have a command of thoroughly useless information."
James Bagdtem
Occasional Advisor

Re: NetBackup Status Script

Thanks guys for the input. Dave, please send your:

/usr/local/bin/systems/veritas/.xbpmonrcdl

as well if you can.

Thanks

James
James Bagdtem
Occasional Advisor

Re: NetBackup Status Script

Does anyone else have any scripts they could send me?

Thanks

James
Chris Vail
Honored Contributor

Re: NetBackup Status Script

You asked for more Netbackup scripts. Here's a one I wrote and use. This is in the form of system documentation. To make this a script, open this MS Word. Highlight the actual script portion, and copy/paste this into notepad and save under a filename. Next ftp this file to your netbackup host. Then use vi and remove the line numbers. Lastly, make the script executable. We use it every day of the week here.


Chris
Chris Vail
Honored Contributor

Re: NetBackup Status Script

Here's another documented Netbackup script. Follow the previous posts' instructions to convert it into a real shell script. I have more of these, but I wanna see what kind of pointage you assign before I post more. ;-)


Chris
James Bagdtem
Occasional Advisor

Re: NetBackup Status Script

Hi Chris

Thanks for the script in your first post, although it's not what I require. I need a script that report the following info:

* Server name
* Date
* Start time
* End time
* Size or amount of data written
* Status (exit code number)
* Transfer rate (kbps) - Optional

The second post had nothing attached! :-)

If you have a script that reports that information and it works for me, it's 10 points right there so don't worry about that.

Cheers

James
Chris Vail
Honored Contributor

Re: NetBackup Status Script

The information that you're looking for is just not av available from Netbackup 3.4. We use it here, and I looked every utility that Netbackup has to offer. I couldn't even assemble it from several different utilities. The start time, end time, and transfer rate is not even available from the GUI, so I don't think that the information even exists in the database.

The best you can do is get the status of all backup jobs on a given date. You can get that from $BPPATH/bpimagelist -media -U -l -d $DDATE -e $EDATE These are $BPPATH: the path to the admincmd dirctory; $DDATE: the start date; $EDATE: the end date. To get the information for a single day, make $EDATE and $DDATE the same. I use this as the heart of my tapeusage script--the one I intended to attach to my last post.

And, because I need 11 points today to hit 1000, I'll re-reply and attach a bonus script.


Chris
Chris Vail
Honored Contributor

Re: NetBackup Status Script

Here's your bonus script. I run it every day at 4PM to tell me how many tapes are in the various and sundry Netbackup pools. If the scratch pool drops below the number of tapes I expect will be used overnight, I use the dateexpire script to increase the size of the scratch pool.
Chris Vail
Honored Contributor

Re: NetBackup Status Script

Here's your bonus script. I run it every day at 4PM to tell me how many tapes are in the various and sundry Netbackup pools. If the scratch pool drops below the number of tapes I expect will be used overnight, I use the dateexpire script to increase the size of the scratch pool. This one actually is the shell script rather than the documentation....which reminds me I need to document this thing.


Chris
Chris Vail
Honored Contributor

Re: NetBackup Status Script

Ooops looks like I fat-fingered the button......... want another script? Okay, here's one that answers part of your question. Again, this is a text file you can just copy it up to your HP host and make it executable.


Chris<--and I almost pressed instead of ---AGAIN!