--=====================_52781065==.ALT
Content-Type: text/plain; charset="us-ascii"; format=flowed
Parse the output of 'bpimagelist -L' instead. It label's everything for you.
... or use NBUX, which will parse the whole thing into Perl hashes for you.
( http://sourceforge.net/projects/nbux )
--PLB
At 02:26 PM 3/6/2003 -0600, Pearson, Gregory M (Getronics) wrote:
>Mark:
>
>First off, thanks for the script. I am using your logic to create a script
>for W2K servers, and change it up a little bit. Do you (or anyone else)
>know what each of the different fields represent in the output of
>bpimagelist or bperror? I want to use awk (for W32) to gather a little bit
>more information, but I haven't found a decent reference on the various
>fields in the output.
>
>Thanks,
>
>Greg Pearson
>-----Original Message-----
>From: Donaldson, Mark [mailto:Mark.Donaldson AT experianems DOT com]
>Sent: Wednesday, March 05, 2003 3:22 PM
>To: Veritasbu (E-mail)
>Subject: RE: [Veritas-bu] Reporting amount backed up per-machine?
>
>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>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>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>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>http://mailman.eng.auburn.edu/mailman/listinfo/veritas-bu
>
>
--=====================_52781065==.ALT
Content-Type: text/html; charset="us-ascii"
<html>
<br>
Parse the output of 'bpimagelist -L' instead. It label's everything
for you.<br><br>
... or use NBUX, which will parse the whole thing into Perl hashes for
you. (
<a href="http://sourceforge.net/projects/nbux"
eudora="autourl">http://sourceforge.net/projects/nbux</a>
)<br><br>
--PLB<br><br>
At 02:26 PM 3/6/2003 -0600, Pearson, Gregory M (Getronics) wrote:<br><br>
<blockquote type=cite class=cite cite><font size=2>Mark:<br>
</font><br>
<font size=2>First off, thanks for the script. I am using your logic to create
a script for W2K servers, and change it up a little bit. Do you (or anyone
else) know what each of the different fields represent in the output of
bpimagelist or bperror? I want to use awk (for W32) to gather a little bit more
information, but I haven't found a decent reference on the various fields in
the output. <br>
</font><br>
<font size=2>Thanks,<br>
</font><br>
<font size=2>Greg Pearson</font>
<dl><font face="tahoma" size=2>
<dd>-----Original Message-----
<dd>From:</b> Donaldson, Mark [<a href="mailto:Mark.Donaldson AT experianems
DOT com" eudora="autourl">mailto:Mark.Donaldson AT experianems DOT com</a>]
<dd>Sent:</b> Wednesday, March 05, 2003 3:22 PM
<dd>To:</b> Veritasbu (E-mail)
<dd>Subject:</b> RE: [Veritas-bu] Reporting amount backed up
per-machine?<br><br>
</font>
<dd>Tim, <font size=2>
<dd>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.</font><font size=2>
<dd>-M</font> <br><br>
<font size=2>
<dd>#!/bin/ksh</font> <br><br>
<font size=2>
<dd>PATH=$PATH:/usr/openv/netbackup/bin/admincmd</font> <font size=2>
<dd>TMPFILE=/var/tmp/`basename $0`.tmp.$$</font> <br><br>
<font size=2>
<dd>hours=24</font> <br><br>
<font size=2>
<dd>echo "## Backup totals by client"</font> <font size=2>
<dd>for client in `bpclclients -allunique -noheader | awk '{print $3}' |
sort`</font> <font size=2>
<dd>do</font> <font size=2>
<dd> bpimagelist -hoursago $hours -client $client 2>/dev/null
>$TMPFILE</font> <font size=2>
<dd> if [ `wc -l $TMPFILE2 | awk '{print $1}` -eq 0 ]</font> <font size=2>
<dd> then</font> <font size=2>
<dd> echo "\n Null
\t$client"</font> <font size=2>
<dd> else</font> <font size=2>
<dd> awk 'BEGIN {sum=0;OFMT="%8.1f"}</font> <font
size=2>
<dd> {if ($1=="IMAGE")
{sum=sum+$19}}</font> <font size=2>
<dd> END { if (sum<1024) {</font> <font size=2>
<dd>
printf ("\n%9.1f KB\t%s\n",sum,"'$client'")</font> <font
size=2>
<dd>
} else {</font> <font size=2>
<dd> if
(sum<1048576) {</font> <font size=2>
<dd>
printf ("\n%9.1f MB\t%s\n",sum/1024,"'$client'")</font>
<font size=2>
<dd>
} else {</font> <font size=2>
<dd>
printf ("\n%9.1f
GB\t%s\n",sum/1024/1024,"'$client'")</font> <font size=2>
<dd>
}}}' $TMPFILE</font> <font size=2>
<dd> for policy in `awk '$1=="IMAGE" {print $7}' $TMPFILE |
sort -u`</font> <font size=2>
<dd> do</font> <font size=2>
<dd> awk 'BEGIN {sum=0;OFMT="%8.1f"}</font> <font
size=2>
<dd> {if ($1=="IMAGE" &&
$7=="'$policy'" ) {sum=sum+$19}}</font> <font size=2>
<dd> END { if (sum<1024) {</font> <font size=2>
<dd>
printf ("\t\t%9.1f KB\tP=%s\n",sum,"'$policy'")</font>
<font size=2>
<dd>
} else {</font> <font size=2>
<dd> if
(sum<1048576) {</font> <font size=2>
<dd>
printf ("\t\t%9.1f
MB\tP=%s\n",sum/1024,"'$policy'")</font> <font size=2>
<dd>
} else {</font> <font size=2>
<dd>
printf ("\t\t%9.1f
GB\tP=%s\n",sum/1024/1024,"'$policy'")</font> <font size=2>
<dd>
}}}' $TMPFILE</font> <font size=2>
<dd> done</font> <font size=2>
<dd> fi</font> <font size=2>
<dd>done</font> <br><br>
<font size=2>
<dd>[ -f $TMPFILE ] && rm -f $TMPFILE</font> <font size=2>
<dd>exit</font> <br><br>
<font size=2>
<dd>-----Original Message-----</font> <font size=2>
<dd>From: Tim McMurphy [<a href="mailto:Tim.McMurphy AT telus DOT
com">mailto:Tim.McMurphy AT telus DOT com</a>]</font> <font size=2>
<dd>Sent: Wednesday, March 05, 2003 1:49 PM</font> <font size=2>
<dd>To: 'Donaldson, Mark'</font> <font size=2>
<dd>Subject: RE: [Veritas-bu] Reporting amount backed up per-machine?</font>
<br><br>
<font size=2>
<dd>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><font size=2>
<dd>Thanks for posting it.</font> <br><br>
<font size=2>
<dd>-----Original Message-----</font> <font size=2>
<dd>From: Donaldson, Mark [<a href="mailto:Mark.Donaldson AT experianems DOT
com">mailto:Mark.Donaldson AT experianems DOT com</a>]</font> <font size=2>
<dd>Sent: Monday, March 03, 2003 10:38 AM</font> <font size=2>
<dd>To: 'H. Wade Minter'; veritas-bu AT mailman.eng.auburn DOT edu</font> <font
size=2>
<dd>Subject: RE: [Veritas-bu] Reporting amount backed up per-machine?</font>
<br><br>
<font size=2>
<dd>This'll report totals for the past 24 hours: </font><font size=2>
<dd>echo "KB\tClient\n--\t------" </font><font size=2>
<dd>for client in `bpclclients -allunique -noheader | awk '{print $3}'`
</font><font size=2>
<dd>do </font><font size=2>
<dd> </font><font size=2>
<dd> bpimagelist -hoursago 24 -client $client 2>/dev/null| \
</font><font size=2>
<dd> awk 'BEGIN {sum=0} </font><font size=2>
<dd> {OFMT="%.1f";if
($1=="IMAGE") {sum=sum+$19}} </font><font size=2>
<dd> END {print sum
"\t'$client'"}' </font><font size=2>
<dd>done </font><font size=2>
<dd>output looks like this </font><font size=2>
<dd>KB Client </font><font size=2>
<dd>-- ------ </font><font size=2>
<dd>0 app00.devel </font><font size=2>
<dd>1507 app00.prod </font><font size=2>
<dd>38924 app00.test </font><font size=2>
<dd>50659 app01.prod </font><font size=2>
<dd>28288 app02.prod </font><font size=2>
<dd><snip> </font><font size=2>
<dd>Note, clients with no backup data show as "0", not as a null
indicator. </font><font size=2>
<dd>-M </font><font size=2>
<dd>-----Original Message----- </font><font size=2>
<dd>From: H. Wade Minter [<a href="mailto:minter AT hcssystems DOT
com">mailto:minter AT hcssystems DOT com</a>] </font><font size=2>
<dd>Sent: Monday, March 03, 2003 8:09 AM </font><font size=2>
<dd>To: veritas-bu AT mailman.eng.auburn DOT edu </font><font size=2>
<dd>Subject: [Veritas-bu] Reporting amount backed up per-machine? </font><font
size=2>
<dd>-----BEGIN PGP SIGNED MESSAGE----- </font><font size=2>
<dd>Hash: SHA1 </font><font size=2>
<dd>Is there a way to query NetBackup to determine how much data was backed up
</font><font size=2>
<dd>per-machine per-night? </font><font size=2>
<dd>For example, I have a backup class with about six machines.
Using </font><font size=2>
<dd>bpmedialist, I can see how much data a _tape_ has on it, but don't know how
</font><font size=2>
<dd>to break it down per-machine. What I'd like to do is be able to query
"How </font><font size=2>
<dd>much data did machine1 back up last night", or last Tuesday, or
whatever. </font><font size=2>
<dd>Is this operation possible in NetBackup 3.4? </font><font size=2>
<dd>Thanks, </font><font size=2>
<dd>Wade </font><font size=2>
<dd>- -- </font><font size=2>
<dd>H. Wade Minter </font><font size=2>
<dd>Senior Unix Systems Engineer </font><font size=2>
<dd>IBM Business Consulting Services, NC Wise Project </font><font size=2>
<dd>-----BEGIN PGP SIGNATURE----- </font><font size=2>
<dd>Version: GnuPG v1.2.1 (GNU/Linux) </font><font size=2>
<dd>iD8DBQE+Y3AajWXVnTuVP7kRAi3/AKDG/Q6czvCpqOiJru0QJBTMVe+x/QCgrjuS
</font><font size=2>
<dd>VL+EymeZO+JNC22iPoR1nmo= </font><font size=2>
<dd>=0Eu+ </font><font size=2>
<dd>-----END PGP SIGNATURE----- </font><font size=2>
<dd>_______________________________________________ </font><font size=2>
<dd>Veritas-bu maillist - Veritas-bu AT mailman.eng.auburn DOT edu
</font><font size=2>
<dd><a
href="http://mailman.eng.auburn.edu/mailman/listinfo/veritas-bu">http://mailman.eng.auburn.edu/mailman/listinfo/veritas-bu</a>
</font>
</dl></blockquote></html>
--=====================_52781065==.ALT--
|