This is a multi-part message in MIME format.
--Boundary_(ID_QHqUSWjO1Zv9AmUHK+l7Zw)
Content-type: text/plain; charset=us-ascii
Content-transfer-encoding: 7BIT
Thanks to Peter, Mark, David, and Alfonso for getting back to me.
One of the guys here, Oleg, has been working on this perl script to
strip down some of the output from the bpdbjobs command.
Thank you Oleg : )
Here it is:
#!/usr/bin/perl
#
# Script to make some sense of the bpdbjobs command output
# Written by Oleg Kokotovic
# Date last modified: 11.11.2003
# define the formats we'll need
format STDOUT_TOP =
Backup reporter
ID Type State Status Class Schedule Client
Date
------------------------------------------------------------------------
--------
.
format STDOUT =
@<< @<<<<<< @<<<<<<<< @<<<<< @<<<<<< @<<<<<<<<<<<<<<< @<<<<<<<
@<<<<<<<<<
$id $type $state $status $class $schedule $client
$date
.
# capture command output and store in array
$cmd = `/usr/openv/netbackup/bin/admincmd/bpdbjobs -report
-all_columns`;
push @array, split (/\n/, $cmd);
# iterate through each of the jobs and extract useful values
foreach $b (@array) {
($id, $type, $state, $status, $class, $schedule, $client,
$server, @rest) = split (/,/, $b);
$date = substr ($rest[42], 0, 10);
# following 2 for loops borrowed from Peter L. Buschman's
function
# parse_bpdbjobs. Thanks Peter
for( $type ) {
/0/ and do { $type = "backup"; last };
/1/ and do { $type = "archive"; last };
/2/ and do { $type = "restore"; last };
} # end for
for( $state ) {
/0/ and do { $state = "queued"; last };
/1/ and do { $state = "active"; last };
/2/ and do { $state = "re-queued"; last };
/3/ and do { $state = "done"; last };
} # end for
# write the formatted output
write;
} # end while
exit;
-----Original Message-----
From: Peter L. Buschman [mailto:plblists AT iotk DOT com]
Sent: Tuesday, 11 November 2003 5:07 AM
To: Donaldson, Mark; 'Nick Lefebvre'; veritas-bu AT mailman.eng.auburn DOT edu
Subject: RE: [Veritas-bu] bpdbjobs script
Here is a Perl function that parses this output neatly. For each line
of bpdbjobs output, pass it into parse_bpdbjobs() and you will
get back a Perl hash of key / value pairs.
--PLB
use Text::ParseWords;
##
## parse_bpdbjobs()
##
## This function is derived from the following Veritas command:
##
## /usr/openv/netbackup/bin/admincmd/bpdbjobs
##
## --PLB 12/19/2001
##
## This function is Copyright (C) 2002 Peter L. Buschman.
## ( Derived from the NBUX Toolkit. )
##
sub parse_bpdbjobs {
$_ = shift;
my $tmpfile;
chomp;
s/'/\\'/g; # Escape any un-escaped single quotes.
##
## jobid,jobtype,state,status,class,schedule, client, server, started,
elapsed,
## ended, stunit, try, operation, kbytes, files, pathlastwritten,
percent,
## jobpid, owner, subtype, classtype, schedule_type, priority, group,
## masterserver, retentionunits, retentionperiod, compression,
## kbyteslastwritten, fileslastwritten, filelistcount, [files]...,
trycount,
## [trypid, trystunit, tryserver, trystarted, tryelapsed, tryended,
trystatus,
## trystatusdescription, trystatuscount, [trystatuslines]...,
trybyteswritten,
## tryfileswritten]
##
my(
$jobid,
$jobtype,
$state,
$status,
$class,
$schedule,
$client,
$server,
$started,
$elapsed,
$ended,
$stunit,
$try,
$operation,
$kbytes,
$files,
$pathlastwritten,
$percent,
$jobpid,
$owner,
$subtype,
$classtype,
$schedule_type,
$priority,
$group,
$masterserver,
$retentionunits,
$retentionperiod,
$compression,
$kbyteslastwritten,
$fileslastwritten,
@files_and_tries,
) = parse_line(",", 0, $_);
for( $jobtype ) {
/0/ and do { $jobtype = "backup" ; last };
/1/ and do { $jobtype = "archive" ; last };
/2/ and do { $jobtype = "restore" ; last };
}
for( $state ) {
/0/ and do { $state = "queued" ; last };
/1/ and do { $state = "active" ; last };
/2/ and do { $state = "re-queued" ; last };
/3/ and do { $state = "done" ; last };
}
my($filelistcount) = shift(@files_and_tries);
my(@files);
for(1..$filelistcount) {
# Skip leading and trailing whitespace
$tmpfile = shift @files_and_tries;
$tmpfile =~ s/^\s*//;
$tmpfile =~ s/\s*$//;
push( @files, $tmpfile );
}
my($specifiedfiles) = join(", ", @files);
my($trycount) = shift(@files_and_tries);
my(%tries,$trynum);
foreach $trynum (1..$trycount) {
my($trypid) = shift(@files_and_tries);
my($trystunit) = shift(@files_and_tries);
my($tryserver) = shift(@files_and_tries);
my($trystarted) = shift(@files_and_tries);
my($tryelapsed) = shift(@files_and_tries);
my($tryended) = shift(@files_and_tries);
my($trystatus) = shift(@files_and_tries);
my($trystatusdescription) = shift(@files_and_tries);
my($trystatuscount) = shift(@files_and_tries);
my(@trystatuslines);
for(1..$trystatuscount) {
push(@trystatuslines, shift(@files_and_tries) );
}
my($trystatuslines) = join("\n", @trystatuslines);
my($trykbyteswritten) = shift(@files_and_tries);
my($tryfileswritten) = shift(@files_and_tries);
%tries = (
%tries,
"try_${trynum}_pid" => "$trypid",
"try_${trynum}_stunit" => "$trystunit",
"try_${trynum}_server" => "$tryserver",
"try_${trynum}_started" => "$trystarted",
"try_${trynum}_elapsed" => "$tryelapsed",
"try_${trynum}_ended" => "$tryended",
"try_${trynum}_status" => "$trystatus",
"try_${trynum}_statusdescription" => "$trystatusdescription",
"try_${trynum}_statuscount" => "$trystatuscount",
"try_${trynum}_statuslines" => "$trystatuslines",
"try_${trynum}_kbyteswritten" => "$trykbyteswritten",
"try_${trynum}_fileswritten" => "$tryfileswritten",
);
}
my($record) = {
jobid=> "$jobid",
jobtype=> "$jobtype",
state=> "$state",
status=> "$status",
class=> "$class",
schedule=> "$schedule",
client=> "$client",
server=> "$server",
started=> "$started",
elapsed=> "$elapsed",
ended=> "$ended",
stunit=> "$stunit",
try=> "$try",
operation=> "$operation",
kbytes=> "$kbytes",
files=> "$specifiedfiles",
path=> "$pathlastwritten",
percent=> "$percent",
jobpid=> "$jobpid",
owner=> "$owner",
subtype=> "$subtype",
classtype=> "$classtype",
schedule_type=> "$schedule_type",
priority=> "$priority",
group=> "$group",
masterserver=> "$masterserver",
retentionunits=> "$retentionunits",
retentionperiod=> "$retentionperiod",
compression=> "$compression",
kbyteslastwritten=> "$kbyteslastwritten",
fileslastwritten=> "$fileslastwritten",
filelistcount=> "$filelistcount",
files=> "$specifiedfiles",
trycount=> "$trycount",
};
%$record = (%$record, %tries);
return %$record;
}
At 09:46 AM 11/10/2003 -0700, Donaldson, Mark wrote:
Storage Mountain's FAQ (http://www.storagemountain.com) has a nice
writeup about this output. The tricky thing to deal with is that the
field count per line differs by job.
-M
-----Original Message-----
From: Nick Lefebvre [mailto:nick AT solnet.com DOT au]
Sent: Sunday, November 09, 2003 9:02 PM
To: veritas-bu AT mailman.eng.auburn DOT edu
Subject: [Veritas-bu] bpdbjobs script
Hi,
I am running the following command:
# ./bpdbjobs report all_columns
The output is messy.
I was wondering whether anyone would have a script to turn this into
something that makes sense?
Thanks for your help.
Cheers,
Nick
--Boundary_(ID_QHqUSWjO1Zv9AmUHK+l7Zw)
Content-type: text/html; charset=us-ascii
Content-transfer-encoding: 7BIT
<html>
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=US-ASCII">
<meta name=Generator content="Microsoft Word 10 (filtered)">
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:blue;
text-decoration:underline;}
tt
{font-family:"Courier New";}
span.EmailStyle18
{font-family:Arial;
color:navy;}
@page Section1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
{page:Section1;}
-->
</style>
</head>
<body lang=EN-US link=blue vlink=blue>
<div class=Section1>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Thanks to Peter, Mark, David, and Alfonso
for getting back to me.</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> </span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>One of the guys here, Oleg, has been
working on this perl script to strip down some of the output from the bpdbjobs
command.</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> </span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Thank you Oleg : )</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> </span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Here it is:</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> </span></font></p>
<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'>#!/usr/bin/perl</span></font></p>
<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'>#</span></font></p>
<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'># Script to make some sense of the bpdbjobs
command output</span></font></p>
<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'># Written by Oleg
Kokotovic</span></font></p>
<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'># Date last modified:
11.11.2003</span></font></p>
<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'> </span></font></p>
<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'># define the formats we'll
need</span></font></p>
<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'>format STDOUT_TOP =</span></font></p>
<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'> </span></font></p>
<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'>
Backup reporter</span></font></p>
<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'>ID Type
State Status Class
Schedule
Client Date</span></font></p>
<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'>--------------------------------------------------------------------------------</span></font></p>
<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'>.</span></font></p>
<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'> </span></font></p>
<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'>format STDOUT =</span></font></p>
<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'>@<<
@<<<<<< @<<<<<<<<
@<<<<< @<<<<<<
@<<<<<<<<<<<<<<<
@<<<<<<<
@<<<<<<<<<</span></font></p>
<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'>$id $type
$state $status $class
$schedule $client
$date</span></font></p>
<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'>.</span></font></p>
<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'> </span></font></p>
<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'># capture command output and store in
array</span></font></p>
<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'>$cmd =
`/usr/openv/netbackup/bin/admincmd/bpdbjobs
-report -all_columns`;</span></font></p>
<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'>push @array, split (/\n/,
$cmd);</span></font></p>
<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'> </span></font></p>
<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'># iterate through each of the jobs and
extract useful values</span></font></p>
<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'>foreach $b (@array) {</span></font></p>
<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'>
($id, $type, $state, $status, $class, $schedule, $client, $server, @rest) =
split (/,/, $b);</span></font></p>
<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'>
$date = substr ($rest[42], 0, 10);</span></font></p>
<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'> </span></font></p>
<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'>
# following 2 for loops borrowed from Peter L. Buschman's
function</span></font></p>
<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'> #
parse_bpdbjobs. Thanks Peter </span></font></p>
<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'>
for(
$type ) {</span></font></p>
<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'>
/0/ and do { $type = "backup"; last };</span></font></p>
<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'>
/1/ and do { $type = "archive"; last };</span></font></p>
<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'>
/2/ and do { $type = "restore"; last };</span></font></p>
<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'> }
# end for</span></font></p>
<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'> </span></font></p>
<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'>
for(
$state ) {</span></font></p>
<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'>
/0/ and do { $state = "queued"; last };</span></font></p>
<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'>
/1/ and do { $state = "active"; last };</span></font></p>
<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'>
/2/ and do { $state = "re-queued"; last };</span></font></p>
<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'>
/3/ and do { $state = "done"; last };</span></font></p>
<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'>
} # end for</span></font></p>
<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'> </span></font></p>
<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'>
# write the formatted output</span></font></p>
<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'>
write;</span></font></p>
<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'>} # end while</span></font></p>
<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'> </span></font></p>
<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'>exit;</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> </span></font></p>
<p class=MsoNormal style='margin-left:36.0pt'><font size=2 face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma'>-----Original Message-----<br>
<b><span style='font-weight:bold'>From:</span></b> Peter L. Buschman
[mailto:plblists AT iotk DOT com] <br>
<b><span style='font-weight:bold'>Sent:</span></b> </span></font><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>Tuesday, 11
November 2003</span></font><font size=2 face=Tahoma><span style='font-size:
10.0pt;font-family:Tahoma'> </span></font><font size=2 face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma'>5:07 AM</span></font><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'><br>
<b><span style='font-weight:bold'>To:</span></b> Donaldson, Mark; 'Nick
Lefebvre'; veritas-bu AT mailman.eng.auburn DOT edu<br>
<b><span style='font-weight:bold'>Subject:</span></b> RE: [Veritas-bu] bpdbjobs
script</span></font></p>
<p class=MsoNormal style='margin-left:36.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'> </span></font></p>
<p class=MsoNormal style='margin-left:36.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'><br>
Here is a Perl function that parses this output neatly. For each line of
bpdbjobs output, pass it into parse_bpdbjobs() and you will<br>
get back a Perl hash of key / value pairs.<br>
<br>
--PLB<br>
<br>
</span></font><tt><font size=2 face="Courier New"><span
style='font-size:10.0pt'>use
Text::ParseWords;</span></font></tt><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'><br>
<br>
<tt><font face="Courier New">##</font></tt><br>
<tt><font face="Courier New">## parse_bpdbjobs()</font></tt><br>
<tt><font face="Courier New">##</font></tt><br>
<tt><font face="Courier New">## This function is derived from the following
Veritas command:</font></tt><br>
<tt><font face="Courier New">##</font></tt><br>
<tt><font face="Courier New">##
/usr/openv/netbackup/bin/admincmd/bpdbjobs</font></tt><br>
<tt><font face="Courier New">##</font></tt><br>
<tt><font face="Courier New">## --PLB </font></tt></span></font><tt><font
size=2 face="Courier New"><span
style='font-size:10.0pt'>12/19/2001</span></font></tt><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier
New"'><br>
<tt><font face="Courier New">##</font></tt><br>
<tt><font face="Courier New">## This function is Copyright (C) 2002 Peter L.
Buschman.</font></tt><br>
<tt><font face="Courier New">## ( Derived from the NBUX Toolkit.
)</font></tt><br>
<tt><font face="Courier New">##</font></tt><br>
<tt><font face="Courier New">sub parse_bpdbjobs {</font></tt><br>
<tt><font face="Courier New"> $_ = shift;</font></tt><br>
<tt><font face="Courier New"> my $tmpfile;</font></tt><br>
<tt><font face="Courier New"> chomp;</font></tt><br>
<tt><font face="Courier New"> s/'/\\'/g; # Escape any un-escaped single
quotes.</font></tt><br>
<tt><font face="Courier New"> ##</font></tt><br>
<tt><font face="Courier New"> ##
jobid,jobtype,state,status,class,schedule, client, server, started,
elapsed,</font></tt><br>
<tt><font face="Courier New"> ## ended, stunit, try, operation, kbytes,
files, pathlastwritten, percent,</font></tt><br>
<tt><font face="Courier New"> ## jobpid, owner, subtype, classtype,
schedule_type, priority, group,</font></tt><br>
<tt><font face="Courier New"> ## masterserver, retentionunits,
retentionperiod, compression,</font></tt><br>
<tt><font face="Courier New"> ## kbyteslastwritten, fileslastwritten,
filelistcount, [files]..., trycount,</font></tt><br>
<tt><font face="Courier New"> ## [trypid, trystunit, tryserver,
trystarted,
tryelapsed, tryended, trystatus,</font></tt><br>
<tt><font face="Courier New"> ## trystatusdescription, trystatuscount,
[trystatuslines]..., trybyteswritten,</font></tt><br>
<tt><font face="Courier New"> ## tryfileswritten]</font></tt><br>
<tt><font face="Courier New"> ##</font></tt><br>
<tt><font face="Courier New"> my(</font></tt><br>
<tt><font face="Courier New">
$jobid,</font></tt><br>
<tt><font face="Courier New">
$jobtype,</font></tt><br>
<tt><font face="Courier New">
$state,</font></tt><br>
<tt><font face="Courier New">
$status,</font></tt><br>
<tt><font face="Courier New">
$class,</font></tt><br>
<tt><font face="Courier New">
$schedule,</font></tt><br>
<tt><font face="Courier New">
$client,</font></tt><br>
<tt><font face="Courier New">
$server,</font></tt><br>
<tt><font face="Courier New">
$started,</font></tt><br>
<tt><font face="Courier New">
$elapsed,</font></tt><br>
<tt><font face="Courier New">
$ended,</font></tt><br>
<tt><font face="Courier New">
$stunit,</font></tt><br>
<tt><font face="Courier New">
$try,</font></tt><br>
<tt><font face="Courier New">
$operation,</font></tt><br>
<tt><font face="Courier New">
$kbytes,</font></tt><br>
<tt><font face="Courier New">
$files,</font></tt><br>
<tt><font face="Courier New">
$pathlastwritten,</font></tt><br>
<tt><font face="Courier New">
$percent,</font></tt><br>
<tt><font face="Courier New">
$jobpid,</font></tt><br>
<tt><font face="Courier New">
$owner,</font></tt><br>
<tt><font face="Courier New">
$subtype,</font></tt><br>
<tt><font face="Courier New">
$classtype,</font></tt><br>
<tt><font face="Courier New">
$schedule_type,</font></tt><br>
<tt><font face="Courier New">
$priority,</font></tt><br>
<tt><font face="Courier New">
$group,</font></tt><br>
<tt><font face="Courier New">
$masterserver,</font></tt><br>
<tt><font face="Courier New">
$retentionunits,</font></tt><br>
<tt><font face="Courier New">
$retentionperiod,</font></tt><br>
<tt><font face="Courier New">
$compression,</font></tt><br>
<tt><font face="Courier New">
$kbyteslastwritten,</font></tt><br>
<tt><font face="Courier New">
$fileslastwritten,</font></tt><br>
<tt><font face="Courier New">
@files_and_tries,</font></tt><br>
<tt><font face="Courier New"> ) = parse_line(",",
0, $_);</font></tt><br>
<tt><font face="Courier New"> for( $jobtype )
{</font></tt><br>
<tt><font face="Courier New"> /0/ and do {
$jobtype = "backup" ; last };</font></tt><br>
<tt><font face="Courier New"> /1/ and do {
$jobtype = "archive" ; last };</font></tt><br>
<tt><font face="Courier New"> /2/ and do {
$jobtype = "restore" ; last };</font></tt><br>
<tt><font face="Courier New"> }</font></tt><br>
<tt><font face="Courier New"> for( $state ) {</font></tt><br>
<tt><font face="Courier New"> /0/ and do { $state
= "queued" ; last };</font></tt><br>
<tt><font face="Courier New"> /1/ and do { $state
= "active" ; last };</font></tt><br>
<tt><font face="Courier New"> /2/ and do { $state
= "re-queued" ; last };</font></tt><br>
<tt><font face="Courier New"> /3/ and do { $state
= "done" ; last
};</font></tt><br>
<tt><font face="Courier New"> }</font></tt><br>
<tt><font face="Courier New">
my($filelistcount)
= shift(@files_and_tries); </font></tt><br>
<tt><font face="Courier New"> my(@files);</font></tt><br>
<tt><font face="Courier New"> for(1..$filelistcount)
{</font></tt><br>
<tt><font face="Courier New"> # Skip leading and
trailing whitespace</font></tt><br>
<tt><font face="Courier New"> $tmpfile = shift
@files_and_tries;</font></tt><br>
<tt><font face="Courier New"> $tmpfile =~
s/^\s*//;</font></tt><br>
<tt><font face="Courier New"> $tmpfile =~
s/\s*$//;</font></tt><br>
<tt><font face="Courier New"> push( @files,
$tmpfile );</font></tt><br>
<tt><font face="Courier New"> }</font></tt><br>
<tt><font face="Courier New"> my($specifiedfiles) =
join(", ", @files);</font></tt><br>
<tt><font face="Courier New">
my($trycount)
= shift(@files_and_tries);</font></tt><br>
<tt><font face="Courier New">
my(%tries,$trynum);</font></tt><br>
<tt><font face="Courier New"> foreach $trynum (1..$trycount)
{</font></tt><br>
<tt><font face="Courier New">
my($trypid)
= shift(@files_and_tries);</font></tt><br>
<tt><font face="Courier New">
my($trystunit)
= shift(@files_and_tries);</font></tt><br>
<tt><font face="Courier New">
my($tryserver)
= shift(@files_and_tries);</font></tt><br>
<tt><font face="Courier New">
my($trystarted)
= shift(@files_and_tries);</font></tt><br>
<tt><font face="Courier New">
my($tryelapsed)
= shift(@files_and_tries);</font></tt><br>
<tt><font face="Courier New">
my($tryended)
= shift(@files_and_tries);</font></tt><br>
<tt><font face="Courier New">
my($trystatus)
= shift(@files_and_tries);</font></tt><br>
<tt><font face="Courier New">
my($trystatusdescription) =
shift(@files_and_tries);</font></tt><br>
<tt><font face="Courier New">
my($trystatuscount)
= shift(@files_and_tries);</font></tt><br>
<tt><font face="Courier New">
my(@trystatuslines);</font></tt><br>
<tt><font face="Courier New">
for(1..$trystatuscount) {</font></tt><br>
<tt><font face="Courier New">
push(@trystatuslines, shift(@files_and_tries) );</font></tt><br>
<tt><font face="Courier New"> }</font></tt><br>
<tt><font face="Courier New"> my($trystatuslines)
= join("\n", @trystatuslines);</font></tt><br>
<tt><font face="Courier New">
my($trykbyteswritten) =
shift(@files_and_tries);</font></tt><br>
<tt><font face="Courier New">
my($tryfileswritten) =
shift(@files_and_tries);</font></tt><br>
<tt><font face="Courier New"> %tries =
(</font></tt><br>
<tt><font face="Courier New">
%tries,</font></tt><br>
<tt><font face="Courier New">
"try_${trynum}_pid"
=> "$trypid",</font></tt><br>
<tt><font face="Courier New">
"try_${trynum}_stunit"
=> "$trystunit",</font></tt><br>
<tt><font face="Courier New">
"try_${trynum}_server"
=> "$tryserver",</font></tt><br>
<tt><font face="Courier New">
"try_${trynum}_started"
=> "$trystarted",</font></tt><br>
<tt><font face="Courier New">
"try_${trynum}_elapsed"
=> "$tryelapsed",</font></tt><br>
<tt><font face="Courier New">
"try_${trynum}_ended"
=> "$tryended",</font></tt><br>
<tt><font face="Courier New">
"try_${trynum}_status"
=> "$trystatus",</font></tt><br>
<tt><font face="Courier New">
"try_${trynum}_statusdescription" =>
"$trystatusdescription",</font></tt><br>
<tt><font face="Courier New">
"try_${trynum}_statuscount" =>
"$trystatuscount",</font></tt><br>
<tt><font face="Courier New">
"try_${trynum}_statuslines" =>
"$trystatuslines",</font></tt><br>
<tt><font face="Courier New">
"try_${trynum}_kbyteswritten" =>
"$trykbyteswritten",</font></tt><br>
<tt><font face="Courier New">
"try_${trynum}_fileswritten" =>
"$tryfileswritten",</font></tt><br>
<tt><font face="Courier New"> );</font></tt><br>
<tt><font face="Courier New"> }</font></tt><br>
<tt><font face="Courier New"> my($record) = {</font></tt><br>
<tt><font face="Courier New">
jobid=>
"$jobid",</font></tt><br>
<tt><font face="Courier New">
jobtype=>
"$jobtype",</font></tt><br>
<tt><font face="Courier New">
state=>
"$state",</font></tt><br>
<tt><font face="Courier New">
status=>
"$status",</font></tt><br>
<tt><font face="Courier New">
class=>
"$class",</font></tt><br>
<tt><font face="Courier New">
schedule=>
"$schedule",</font></tt><br>
<tt><font face="Courier New">
client=>
"$client",</font></tt><br>
<tt><font face="Courier New">
server=>
"$server",</font></tt><br>
<tt><font face="Courier New">
started=>
"$started",</font></tt><br>
<tt><font face="Courier New">
elapsed=>
"$elapsed",</font></tt><br>
<tt><font face="Courier New">
ended=>
"$ended",</font></tt><br>
<tt><font face="Courier New">
stunit=>
"$stunit",</font></tt><br>
<tt><font face="Courier New">
try=>
"$try",</font></tt><br>
<tt><font face="Courier New">
operation=>
"$operation",</font></tt><br>
<tt><font face="Courier New">
kbytes=>
"$kbytes",</font></tt><br>
<tt><font face="Courier New">
files=>
"$specifiedfiles",</font></tt><br>
<tt><font face="Courier New">
path=>
"$pathlastwritten",</font></tt><br>
<tt><font face="Courier New">
percent=>
"$percent",</font></tt><br>
<tt><font face="Courier New">
jobpid=>
"$jobpid",</font></tt><br>
<tt><font face="Courier New">
owner=>
"$owner",</font></tt><br>
<tt><font face="Courier New">
subtype=>
"$subtype",</font></tt><br>
<tt><font face="Courier New">
classtype=>
"$classtype",</font></tt><br>
<tt><font face="Courier New">
schedule_type=>
"$schedule_type",</font></tt><br>
<tt><font face="Courier New">
priority=>
"$priority",</font></tt><br>
<tt><font face="Courier New">
group=>
"$group",</font></tt><br>
<tt><font face="Courier New">
masterserver=>
"$masterserver",</font></tt><br>
<tt><font face="Courier New">
retentionunits=>
"$retentionunits",</font></tt><br>
<tt><font face="Courier New">
retentionperiod=>
"$retentionperiod",</font></tt><br>
<tt><font face="Courier New">
compression=>
"$compression",</font></tt><br>
<tt><font face="Courier New">
kbyteslastwritten=> "$kbyteslastwritten",</font></tt><br>
<tt><font face="Courier New">
fileslastwritten=> "$fileslastwritten",</font></tt><br>
<tt><font face="Courier New">
filelistcount=>
"$filelistcount",</font></tt><br>
<tt><font face="Courier New">
files=>
"$specifiedfiles",</font></tt><br>
<tt><font face="Courier New">
trycount=>
"$trycount",</font></tt><br>
<tt><font face="Courier New"> };</font></tt><br>
<tt><font face="Courier New"> %$record = (%$record,
%tries);</font></tt><br>
<tt><font face="Courier New"> return %$record;</font></tt><br>
<tt><font face="Courier New">}</font></tt><br>
<br>
<br>
</span></font>At 09:46 AM 11/10/2003 -0700, Donaldson, Mark wrote:<br>
<br>
</p>
<p class=MsoNormal style='margin-left:36.0pt'><font size=2 color=blue
face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:blue'>Storage</span></font><font
size=2 color=blue face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:blue'> </span></font><font size=2 color=blue face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:blue'>Mountain</span></font><font
size=2 color=blue face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:blue'>'s FAQ (<a
href="http://www.storagemountain.com">http://www.storagemountain.com</a>)
has a nice writeup about this output. The tricky thing to deal with is
that the field count per line differs by job.</span></font><br>
<br>
<font size=2 color=blue face=Arial><span style='font-size:10.0pt;font-family:
Arial;color:blue'>-M</span></font></p>
<p class=MsoNormal style='margin-left:72.0pt'><font size=2 face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma'>-----Original
Message-----</span></font></p>
<p class=MsoNormal style='margin-left:72.0pt'><font size=2 face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma'>From: Nick Lefebvre [<a
href="mailto:nick AT solnet.com DOT au" eudora=autourl>mailto:nick AT
solnet.com DOT au</a>]</span></font></p>
<p class=MsoNormal style='margin-left:72.0pt'><font size=2 face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma'>Sent: </span></font><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>Sunday,
November 09, 2003</span></font><font size=2 face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma'> </span></font><font
size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>9:02
PM</span></font></p>
<p class=MsoNormal style='margin-left:72.0pt'><font size=2 face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma'>To:
veritas-bu AT mailman.eng.auburn DOT edu</span></font></p>
<p class=MsoNormal style='margin-right:0cm;margin-bottom:12.0pt;margin-left:
72.0pt'><font size=2 face=Tahoma><span style='font-size:10.0pt;font-family:
Tahoma'>Subject: [Veritas-bu] bpdbjobs script</span></font></p>
<p class=MsoNormal style='margin-right:0cm;margin-bottom:12.0pt;margin-left:
72.0pt'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>Hi,</span></font></p>
<p class=MsoNormal style='margin-right:0cm;margin-bottom:12.0pt;margin-left:
72.0pt'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'> </span></font></p>
<p class=MsoNormal style='margin-right:0cm;margin-bottom:12.0pt;margin-left:
72.0pt'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>I
am running the following command:</span></font></p>
<p class=MsoNormal style='margin-right:0cm;margin-bottom:12.0pt;margin-left:
72.0pt'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'> </span></font></p>
<p class=MsoNormal style='margin-right:0cm;margin-bottom:12.0pt;margin-left:
72.0pt'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>#
./bpdbjobs report all_columns</span></font></p>
<p class=MsoNormal style='margin-right:0cm;margin-bottom:12.0pt;margin-left:
72.0pt'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'> </span></font></p>
<p class=MsoNormal style='margin-right:0cm;margin-bottom:12.0pt;margin-left:
72.0pt'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>The
output is messy.</span></font></p>
<p class=MsoNormal style='margin-right:0cm;margin-bottom:12.0pt;margin-left:
72.0pt'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'> </span></font></p>
<p class=MsoNormal style='margin-right:0cm;margin-bottom:12.0pt;margin-left:
72.0pt'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>I
was wondering whether anyone would have a script to turn this into something
that makes sense?</span></font></p>
<p class=MsoNormal style='margin-right:0cm;margin-bottom:12.0pt;margin-left:
72.0pt'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'> </span></font></p>
<p class=MsoNormal style='margin-right:0cm;margin-bottom:12.0pt;margin-left:
72.0pt'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>Thanks
for your help.</span></font></p>
<p class=MsoNormal style='margin-right:0cm;margin-bottom:12.0pt;margin-left:
72.0pt'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'> </span></font></p>
<p class=MsoNormal style='margin-right:0cm;margin-bottom:12.0pt;margin-left:
72.0pt'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>Cheers,</span></font></p>
<p class=MsoNormal style='margin-right:0cm;margin-bottom:12.0pt;margin-left:
72.0pt'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'> </span></font></p>
<p class=MsoNormal style='margin-left:72.0pt'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>Nick</span></font></p>
</div>
</body>
</html>
--Boundary_(ID_QHqUSWjO1Zv9AmUHK+l7Zw)--
|