Veritas-bu

[Veritas-bu] Reporting amount backed up per-machine?

2003-03-05 16:21:32
Subject: [Veritas-bu] Reporting amount backed up per-machine?
From: Mark.Donaldson AT experianems DOT com (Donaldson, Mark)
Date: Wed, 5 Mar 2003 14:21:32 -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_01C2E35D.31759B90
Content-Type: text/plain;
        charset="iso-8859-1"

Tim,
Try this version, then.  I improved the script after the original posting
for my own internal use - the non-backups show as "null" and there's
subtotals for the each class/policy per client.

-M

#!/bin/ksh

PATH=$PATH:/usr/openv/netbackup/bin/admincmd
TMPFILE=/var/tmp/`basename $0`.tmp.$$

hours=24

echo "## Backup totals by client"
for client in `bpclclients -allunique -noheader | awk '{print $3}' | sort`
do
  bpimagelist -hoursago $hours -client $client 2>/dev/null >$TMPFILE
  if [ `wc -l $TMPFILE2 | awk '{print $1}` -eq 0 ]
  then
    echo "\n     Null   \t$client"
  else
    awk 'BEGIN {sum=0;OFMT="%8.1f"}
      {if ($1=="IMAGE") {sum=sum+$19}}
      END { if (sum<1024) {
              printf ("\n%9.1f KB\t%s\n",sum,"'$client'")
                         } else {
            if (sum<1048576) {
              printf ("\n%9.1f MB\t%s\n",sum/1024,"'$client'")
                             } else {
              printf ("\n%9.1f GB\t%s\n",sum/1024/1024,"'$client'")
                  }}}' $TMPFILE
  for policy in `awk '$1=="IMAGE" {print $7}' $TMPFILE | sort -u`
  do
    awk 'BEGIN {sum=0;OFMT="%8.1f"}
      {if ($1=="IMAGE" && $7=="'$policy'" ) {sum=sum+$19}}
      END { if (sum<1024) {
              printf ("\t\t%9.1f KB\tP=%s\n",sum,"'$policy'")
                         } else {
            if (sum<1048576) {
              printf ("\t\t%9.1f MB\tP=%s\n",sum/1024,"'$policy'")
                             } else {
              printf ("\t\t%9.1f GB\tP=%s\n",sum/1024/1024,"'$policy'")
                  }}}' $TMPFILE
  done
  fi
done

[ -f $TMPFILE ] && rm -f $TMPFILE
exit

-----Original Message-----
From: Tim McMurphy [mailto:Tim.McMurphy AT telus DOT com]
Sent: Wednesday, March 05, 2003 1:49 PM
To: 'Donaldson, Mark'
Subject: RE: [Veritas-bu] Reporting amount backed up per-machine?


Cool script. I use it a bit differently. I already had one that showed what
was backed up and how much but I was looking for one that would show if a
client didn't back up but didn't give any errors (has happened before). The
zero is and easy one to parse for.

Thanks for posting it.

-----Original Message-----
From: Donaldson, Mark [mailto:Mark.Donaldson AT experianems DOT com]
Sent: Monday, March 03, 2003 10:38 AM
To: 'H. Wade Minter'; veritas-bu AT mailman.eng.auburn DOT edu
Subject: RE: [Veritas-bu] Reporting amount backed up per-machine?


This'll report totals for the past 24 hours: 
echo "KB\tClient\n--\t------" 
for client in `bpclclients -allunique -noheader | awk '{print $3}'` 
do 
  
  bpimagelist -hoursago 24 -client $client 2>/dev/null| \ 
    awk 'BEGIN {sum=0} 
        {OFMT="%.1f";if ($1=="IMAGE") {sum=sum+$19}} 
        END {print sum "\t'$client'"}' 
done 
output looks like this 
KB        Client 
--      ------ 
0       app00.devel 
1507    app00.prod 
38924   app00.test 
50659   app01.prod 
28288   app02.prod 
<snip> 
Note, clients with no backup data show as "0", not as a null indicator. 
-M 


-----Original Message----- 
From: H. Wade Minter [mailto:minter AT hcssystems DOT com] 
Sent: Monday, March 03, 2003 8:09 AM 
To: veritas-bu AT mailman.eng.auburn DOT edu 
Subject: [Veritas-bu] Reporting amount backed up per-machine? 


-----BEGIN PGP SIGNED MESSAGE----- 
Hash: SHA1 
Is there a way to query NetBackup to determine how much data was backed up 
per-machine per-night? 
For example, I have a backup class with about six machines.   Using 
bpmedialist, I can see how much data a _tape_ has on it, but don't know how 
to break it down per-machine.  What I'd like to do is be able to query "How 
much data did machine1 back up last night", or last Tuesday, or whatever. 
Is this operation possible in NetBackup 3.4? 
Thanks, 
Wade 
- -- 
H. Wade Minter 
Senior Unix Systems Engineer 
IBM Business Consulting Services, NC Wise Project 
-----BEGIN PGP SIGNATURE----- 
Version: GnuPG v1.2.1 (GNU/Linux) 
iD8DBQE+Y3AajWXVnTuVP7kRAi3/AKDG/Q6czvCpqOiJru0QJBTMVe+x/QCgrjuS 
VL+EymeZO+JNC22iPoR1nmo= 
=0Eu+ 
-----END PGP SIGNATURE----- 


_______________________________________________ 
Veritas-bu maillist  -  Veritas-bu AT mailman.eng.auburn DOT edu 
http://mailman.eng.auburn.edu/mailman/listinfo/veritas-bu 

------_=_NextPart_001_01C2E35D.31759B90
Content-Type: text/html;
        charset="iso-8859-1"
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=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2653.12">
<TITLE>RE: [Veritas-bu] Reporting amount backed up per-machine?</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=3D2>Tim,</FONT>
<BR><FONT SIZE=3D2>Try this version, then.&nbsp; I improved the script =
after the original posting for my own internal use - the non-backups =
show as &quot;null&quot; and there's subtotals for the each =
class/policy per client.</FONT></P>

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

<P><FONT SIZE=3D2>#!/bin/ksh</FONT>
</P>

<P><FONT SIZE=3D2>PATH=3D$PATH:/usr/openv/netbackup/bin/admincmd</FONT>
<BR><FONT SIZE=3D2>TMPFILE=3D/var/tmp/`basename $0`.tmp.$$</FONT>
</P>

<P><FONT SIZE=3D2>hours=3D24</FONT>
</P>

<P><FONT SIZE=3D2>echo &quot;## Backup totals by client&quot;</FONT>
<BR><FONT SIZE=3D2>for client in `bpclclients -allunique -noheader | =
awk '{print $3}' | sort`</FONT>
<BR><FONT SIZE=3D2>do</FONT>
<BR><FONT SIZE=3D2>&nbsp; bpimagelist -hoursago $hours -client $client =
2&gt;/dev/null &gt;$TMPFILE</FONT>
<BR><FONT SIZE=3D2>&nbsp; if [ `wc -l $TMPFILE2 | awk '{print $1}` -eq =
0 ]</FONT>
<BR><FONT SIZE=3D2>&nbsp; then</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp; echo =
&quot;\n&nbsp;&nbsp;&nbsp;&nbsp; Null&nbsp;&nbsp; =
\t$client&quot;</FONT>
<BR><FONT SIZE=3D2>&nbsp; else</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp; awk 'BEGIN =
{sum=3D0;OFMT=3D&quot;%8.1f&quot;}</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {if =
($1=3D=3D&quot;IMAGE&quot;) {sum=3Dsum+$19}}</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; END { if =
(sum&lt;1024) {</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp; printf (&quot;\n%9.1f =
KB\t%s\n&quot;,sum,&quot;'$client'&quot;)</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp; } else {</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp; if (sum&lt;1048576) {</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp; printf (&quot;\n%9.1f =
MB\t%s\n&quot;,sum/1024,&quot;'$client'&quot;)</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } else {</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp; printf (&quot;\n%9.1f =
GB\t%s\n&quot;,sum/1024/1024,&quot;'$client'&quot;)</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }}}' $TMPFILE</FONT>
<BR><FONT SIZE=3D2>&nbsp; for policy in `awk '$1=3D=3D&quot;IMAGE&quot; =
{print $7}' $TMPFILE | sort -u`</FONT>
<BR><FONT SIZE=3D2>&nbsp; do</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp; awk 'BEGIN =
{sum=3D0;OFMT=3D&quot;%8.1f&quot;}</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {if =
($1=3D=3D&quot;IMAGE&quot; &amp;&amp; $7=3D=3D&quot;'$policy'&quot; ) =
{sum=3Dsum+$19}}</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; END { if =
(sum&lt;1024) {</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp; printf (&quot;\t\t%9.1f =
KB\tP=3D%s\n&quot;,sum,&quot;'$policy'&quot;)</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp; } else {</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp; if (sum&lt;1048576) {</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp; printf (&quot;\t\t%9.1f =
MB\tP=3D%s\n&quot;,sum/1024,&quot;'$policy'&quot;)</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } else {</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp; printf (&quot;\t\t%9.1f =
GB\tP=3D%s\n&quot;,sum/1024/1024,&quot;'$policy'&quot;)</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }}}' $TMPFILE</FONT>
<BR><FONT SIZE=3D2>&nbsp; done</FONT>
<BR><FONT SIZE=3D2>&nbsp; fi</FONT>
<BR><FONT SIZE=3D2>done</FONT>
</P>

<P><FONT SIZE=3D2>[ -f $TMPFILE ] &amp;&amp; rm -f $TMPFILE</FONT>
<BR><FONT SIZE=3D2>exit</FONT>
</P>

<P><FONT SIZE=3D2>-----Original Message-----</FONT>
<BR><FONT SIZE=3D2>From: Tim McMurphy [<A =
HREF=3D"mailto:Tim.McMurphy AT telus DOT com">mailto:Tim.McMurphy AT telus DOT 
com</A>=
]</FONT>
<BR><FONT SIZE=3D2>Sent: Wednesday, March 05, 2003 1:49 PM</FONT>
<BR><FONT SIZE=3D2>To: 'Donaldson, Mark'</FONT>
<BR><FONT SIZE=3D2>Subject: RE: [Veritas-bu] Reporting amount backed up =
per-machine?</FONT>
</P>
<BR>

<P><FONT SIZE=3D2>Cool script. I use it a bit differently. I already =
had one that showed what was backed up and how much but I was looking =
for one that would show if a client didn't back up but didn't give any =
errors (has happened before). The zero is and easy one to parse =
for.</FONT></P>

<P><FONT SIZE=3D2>Thanks for posting it.</FONT>
</P>

<P><FONT SIZE=3D2>-----Original Message-----</FONT>
<BR><FONT SIZE=3D2>From: Donaldson, Mark [<A =
HREF=3D"mailto:Mark.Donaldson AT experianems DOT com">mailto:Mark.Donaldson@exp=
erianems.com</A>]</FONT>
<BR><FONT SIZE=3D2>Sent: Monday, March 03, 2003 10:38 AM</FONT>
<BR><FONT SIZE=3D2>To: 'H. Wade Minter'; =
veritas-bu AT mailman.eng.auburn DOT edu</FONT>
<BR><FONT SIZE=3D2>Subject: RE: [Veritas-bu] Reporting amount backed up =
per-machine?</FONT>
</P>
<BR>

<P><FONT SIZE=3D2>This'll report totals for the past 24 hours: </FONT>
<BR><FONT SIZE=3D2>echo &quot;KB\tClient\n--\t------&quot; </FONT>
<BR><FONT SIZE=3D2>for client in `bpclclients -allunique -noheader | =
awk '{print $3}'` </FONT>
<BR><FONT SIZE=3D2>do </FONT>
<BR><FONT SIZE=3D2>&nbsp; </FONT>
<BR><FONT SIZE=3D2>&nbsp; bpimagelist -hoursago 24 -client $client =
2&gt;/dev/null| \ </FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp; awk 'BEGIN {sum=3D0} </FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
{OFMT=3D&quot;%.1f&quot;;if ($1=3D=3D&quot;IMAGE&quot;) =
{sum=3Dsum+$19}} </FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; END =
{print sum &quot;\t'$client'&quot;}' </FONT>
<BR><FONT SIZE=3D2>done </FONT>
<BR><FONT SIZE=3D2>output looks like this </FONT>
<BR><FONT SIZE=3D2>KB&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Client =
</FONT>
<BR><FONT SIZE=3D2>--&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ------ </FONT>
<BR><FONT SIZE=3D2>0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; app00.devel =
</FONT>
<BR><FONT SIZE=3D2>1507&nbsp;&nbsp;&nbsp; app00.prod </FONT>
<BR><FONT SIZE=3D2>38924&nbsp;&nbsp; app00.test </FONT>
<BR><FONT SIZE=3D2>50659&nbsp;&nbsp; app01.prod </FONT>
<BR><FONT SIZE=3D2>28288&nbsp;&nbsp; app02.prod </FONT>
<BR><FONT SIZE=3D2>&lt;snip&gt; </FONT>
<BR><FONT SIZE=3D2>Note, clients with no backup data show as =
&quot;0&quot;, not as a null indicator. </FONT>
<BR><FONT SIZE=3D2>-M </FONT>
</P>
<BR>

<P><FONT SIZE=3D2>-----Original Message----- </FONT>
<BR><FONT SIZE=3D2>From: H. Wade Minter [<A =
HREF=3D"mailto:minter AT hcssystems DOT com">mailto:minter AT hcssystems DOT 
com</A>] =
</FONT>
<BR><FONT SIZE=3D2>Sent: Monday, March 03, 2003 8:09 AM </FONT>
<BR><FONT SIZE=3D2>To: veritas-bu AT mailman.eng.auburn DOT edu </FONT>
<BR><FONT SIZE=3D2>Subject: [Veritas-bu] Reporting amount backed up =
per-machine? </FONT>
</P>
<BR>

<P><FONT SIZE=3D2>-----BEGIN PGP SIGNED MESSAGE----- </FONT>
<BR><FONT SIZE=3D2>Hash: SHA1 </FONT>
<BR><FONT SIZE=3D2>Is there a way to query NetBackup to determine how =
much data was backed up </FONT>
<BR><FONT SIZE=3D2>per-machine per-night? </FONT>
<BR><FONT SIZE=3D2>For example, I have a backup class with about six =
machines.&nbsp;&nbsp; Using </FONT>
<BR><FONT SIZE=3D2>bpmedialist, I can see how much data a _tape_ has on =
it, but don't know how </FONT>
<BR><FONT SIZE=3D2>to break it down per-machine.&nbsp; What I'd like to =
do is be able to query &quot;How </FONT>
<BR><FONT SIZE=3D2>much data did machine1 back up last night&quot;, or =
last Tuesday, or whatever. </FONT>
<BR><FONT SIZE=3D2>Is this operation possible in NetBackup 3.4? </FONT>
<BR><FONT SIZE=3D2>Thanks, </FONT>
<BR><FONT SIZE=3D2>Wade </FONT>
<BR><FONT SIZE=3D2>- -- </FONT>
<BR><FONT SIZE=3D2>H. Wade Minter </FONT>
<BR><FONT SIZE=3D2>Senior Unix Systems Engineer </FONT>
<BR><FONT SIZE=3D2>IBM Business Consulting Services, NC Wise Project =
</FONT>
<BR><FONT SIZE=3D2>-----BEGIN PGP SIGNATURE----- </FONT>
<BR><FONT SIZE=3D2>Version: GnuPG v1.2.1 (GNU/Linux) </FONT>
<BR><FONT =
SIZE=3D2>iD8DBQE+Y3AajWXVnTuVP7kRAi3/AKDG/Q6czvCpqOiJru0QJBTMVe+x/QCgrju=
S </FONT>
<BR><FONT SIZE=3D2>VL+EymeZO+JNC22iPoR1nmo=3D </FONT>
<BR><FONT SIZE=3D2>=3D0Eu+ </FONT>
<BR><FONT SIZE=3D2>-----END PGP SIGNATURE----- </FONT>
</P>
<BR>

<P><FONT SIZE=3D2>_______________________________________________ =
</FONT>
<BR><FONT SIZE=3D2>Veritas-bu maillist&nbsp; -&nbsp; =
Veritas-bu AT mailman.eng.auburn DOT edu </FONT>
<BR><FONT SIZE=3D2><A =
HREF=3D"http://mailman.eng.auburn.edu/mailman/listinfo/veritas-bu"; =
TARGET=3D"_blank">http://mailman.eng.auburn.edu/mailman/listinfo/veritas=
-bu</A> </FONT>
</P>

</BODY>
</HTML>
------_=_NextPart_001_01C2E35D.31759B90--