Veritas-bu

[Veritas-bu] Drive Utilization

2002-03-28 19:13:35
Subject: [Veritas-bu] Drive Utilization
From: Mark.Donaldson AT experianems DOT com (Donaldson, Mark)
Date: Thu, 28 Mar 2002 17:13:35 -0700
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C1D6B6.91A3D630
Content-Type: text/plain

Repost trimmed for size:

Here's a simple job report.  Feed it the jobid on the cmd line and it'll
kick out tapes, rates, etc.  It'd be better to do a "Past 24 hrs" type
report.  I'll work on it tomorrow.
-M

$ ./job_report 183160
 jobid: 183160
status: 0
 class: Oracle_mm
 sched: mm
kbytes: 42577367
 files: 161
Write Time: 003:57:51
Avg Write Rate: 2983.49 kb/sec
Avg File Size: 264456 kb
Tapes Used: 000101,000367,000166

Here's the script:

#!/bin/ksh
PATH=$PATH:/usr/openv/netbackup/bin/admincmd
export PATH

jobid=$1
if [ -z "$jobid" ]
then
  echo "Usage: `basename $0` jobid"
else
  bpdbjobs -report -all_columns | grep "^$jobid," | tr ',' "\012" | \
  awk ' BEGIN { tapes="" }
        {if ( NR== 1 ) {print " jobid: "$1}
         if ( NR== 4 ) {print "status: "$1}
         if ( NR== 5 ) {print " class: "$1}
         if ( NR== 6 ) {print " sched: "$1}
         if ( NR==15 ) {print "kbytes: "$1 ; kb=$1}
         if ( NR==16 ) {print " files: "$1 ; files=$1}
         if ( $0~/mounting/ ) {
            if ( tapes=="" ) {tapes=$5}
            else {tapes=tapes","$5} }
         if ( $0~/end writing/ ) {time=$8}
        }
        END {if ( time != "" ) {
             print "Write Time: "time
             count=split( time, sub,":")
             sec=sub[1]*3600 + sub[2]*60 + sub[3]
             print "Avg Write Rate: " kb/sec " kb/sec"
             print "Avg File Size: " kb/files " kb"
             print "Tapes Used: " tapes
            } else {
            print "Write time not found" }
        } '
fi
exit


-----Original Message-----

Whoa - what a challenge!

It's a cool idea - should be available from the bpdbjobs (all_columns)
report since it contains all the positioning and mounting information on a
per-job basis.  Parse it for tape mount info & times, do some math.  Easy,
right?  :)

It's a cool idea - I'll let you know if I ever try it out - one trouble is
line-length limitations in awk - this output is HUGE!.

-Mark

-----Original Message-----
From: Dan Dobbs

Is there a way to compute 'real' backup times, however?

<snip>

------_=_NextPart_001_01C1D6B6.91A3D630
Content-Type: text/html
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3DUS-ASCII">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2653.12">
<TITLE>Re: [Veritas-bu] Drive Utilization</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=3D2>Repost trimmed for size:</FONT>
</P>

<P><FONT SIZE=3D2>Here's a simple job report.&nbsp; Feed it the jobid =
on the cmd line and it'll kick out tapes, rates, etc.&nbsp; It'd be =
better to do a &quot;Past 24 hrs&quot; type report.&nbsp; I'll work on =
it tomorrow.</FONT></P>

<P><FONT SIZE=3D2>-M</FONT>
</P>

<P><FONT SIZE=3D2>$ ./job_report 183160</FONT>
<BR><FONT SIZE=3D2>&nbsp;jobid: 183160</FONT>
<BR><FONT SIZE=3D2>status: 0</FONT>
<BR><FONT SIZE=3D2>&nbsp;class: Oracle_mm</FONT>
<BR><FONT SIZE=3D2>&nbsp;sched: mm</FONT>
<BR><FONT SIZE=3D2>kbytes: 42577367</FONT>
<BR><FONT SIZE=3D2>&nbsp;files: 161</FONT>
<BR><FONT SIZE=3D2>Write Time: 003:57:51</FONT>
<BR><FONT SIZE=3D2>Avg Write Rate: 2983.49 kb/sec</FONT>
<BR><FONT SIZE=3D2>Avg File Size: 264456 kb</FONT>
<BR><FONT SIZE=3D2>Tapes Used: 000101,000367,000166</FONT>
</P>

<P><FONT SIZE=3D2>Here's the script:</FONT>
</P>

<P><FONT SIZE=3D2>#!/bin/ksh</FONT>
<BR><FONT =
SIZE=3D2>PATH=3D$PATH:/usr/openv/netbackup/bin/admincmd</FONT>
<BR><FONT SIZE=3D2>export PATH</FONT>
</P>

<P><FONT SIZE=3D2>jobid=3D$1</FONT>
<BR><FONT SIZE=3D2>if [ -z &quot;$jobid&quot; ]</FONT>
<BR><FONT SIZE=3D2>then</FONT>
<BR><FONT SIZE=3D2>&nbsp; echo &quot;Usage: `basename $0` =
jobid&quot;</FONT>
<BR><FONT SIZE=3D2>else</FONT>
<BR><FONT SIZE=3D2>&nbsp; bpdbjobs -report -all_columns | grep =
&quot;^$jobid,&quot; | tr ',' &quot;\012&quot; | \</FONT>
<BR><FONT SIZE=3D2>&nbsp; awk ' BEGIN { tapes=3D&quot;&quot; }</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {if ( =
NR=3D=3D 1 ) {print &quot; jobid: &quot;$1}</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if =
( NR=3D=3D 4 ) {print &quot;status: &quot;$1}</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if =
( NR=3D=3D 5 ) {print &quot; class: &quot;$1}</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if =
( NR=3D=3D 6 ) {print &quot; sched: &quot;$1}</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if =
( NR=3D=3D15 ) {print &quot;kbytes: &quot;$1 ; kb=3D$1}</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if =
( NR=3D=3D16 ) {print &quot; files: &quot;$1 ; files=3D$1}</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if =
( $0~/mounting/ ) {</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp; if ( tapes=3D=3D&quot;&quot; ) {tapes=3D$5}</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp; else {tapes=3Dtapes&quot;,&quot;$5} }</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if =
( $0~/end writing/ ) {time=3D$8}</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; END {if ( =
time !=3D &quot;&quot; ) {</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp; print &quot;Write Time: &quot;time</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp; count=3Dsplit( time, sub,&quot;:&quot;)</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp; sec=3Dsub[1]*3600 + sub[2]*60 + sub[3]</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp; print &quot;Avg Write Rate: &quot; kb/sec &quot; =
kb/sec&quot;</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp; print &quot;Avg File Size: &quot; kb/files &quot; =
kb&quot;</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp; print &quot;Tapes Used: &quot; tapes</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp; } else {</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp; print &quot;Write time not found&quot; }</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } =
'</FONT>
<BR><FONT SIZE=3D2>fi</FONT>
<BR><FONT SIZE=3D2>exit</FONT>
</P>
<BR>

<P><FONT SIZE=3D2>-----Original Message-----</FONT>
</P>

<P><FONT SIZE=3D2>Whoa - what a challenge!</FONT>
</P>

<P><FONT SIZE=3D2>It's a cool idea - should be available from the =
bpdbjobs (all_columns) report since it contains all the positioning and =
mounting information on a per-job basis.&nbsp; Parse it for tape mount =
info &amp; times, do some math.&nbsp; Easy, right?&nbsp; :)</FONT></P>

<P><FONT SIZE=3D2>It's a cool idea - I'll let you know if I ever try it =
out - one trouble is line-length limitations in awk - this output is =
HUGE!.</FONT></P>

<P><FONT SIZE=3D2>-Mark</FONT>
</P>

<P><FONT SIZE=3D2>-----Original Message-----</FONT>
<BR><FONT SIZE=3D2>From: Dan Dobbs</FONT>
</P>

<P><FONT SIZE=3D2>Is there a way to compute 'real' backup times, =
however?</FONT>
</P>

<P><FONT SIZE=3D2>&lt;snip&gt;</FONT>
</P>

</BODY>
</HTML>
------_=_NextPart_001_01C1D6B6.91A3D630--

<Prev in Thread] Current Thread [Next in Thread>