Veritas-bu

Re: [Veritas-bu] Total Client Data

2009-04-22 13:59:18
Subject: Re: [Veritas-bu] Total Client Data
From: "Donaldson, Mark" <Mark.Donaldson AT Staples DOT com>
To: <VERITAS-BU AT MAILMAN.ENG.AUBURN DOT EDU>
Date: Wed, 22 Apr 2009 11:56:03 -0600
Hi,

The source of the raw information is the image database.  Here's a
script for you.  Note, this doesn't take into account multiple copies of
one image - it's just a total of the image sizes, ie: sourced data.  If
you want to have total data written onto the tape, multiply the $19
param by field $21 (number of copies) in order to get total *written*
data.

By default, this script searches back 7 days.  Supply a different number
of days on the command line to change the search depth.  If you want the
entire history of you box, you'll have to search past your longest
retention period (or change bpimage to use a date field rather than the
"hoursago" option).

output looks like this:
============================================
Report client read totals for past 4 days.
============================================
      Server-lt-75-v      46.46 MB
      Server-lt-48-v      46.85 MB
        Server-tm-07      67.57 GB
      Server-lt-94-v      24.39 MB
      Server-lt-76-v      39.80 MB
        Server-ad-30     145.11 MB
      Server-lt-95-v      46.90 MB
      Server-lp-99-v     165.89 MB
=========================================
Total of all Clients      42.71 TB



.........................................

#!/bin/ksh

PATH=$PATH:/usr/openv/netbackup/bin/admincmd

#command line or 7 days
daysago=${1:-7}

echo "================================================="
echo "Report client read totals for past $daysago days."
echo "=================================================\n"

hoursago=`expr $daysago \* 24`

bpimagelist -hoursago $hoursago | \
  awk 'BEGIN {tsum=0}
   {if($1=="IMAGE"){
    clientnames[$2]
    csum[$2]=csum[$2] + $19}}
   END { for (c in clientnames) {
        UNIT="KB"
        tsum=tsum+csum[c]
        if (csum[c]>10240) {csum[c]=csum[c]/1024;UNIT="MB"}
        if (csum[c]>10240) {csum[c]=csum[c]/1024;UNIT="GB"}
        if (csum[c]>10240) {csum[c]=csum[c]/1024;UNIT="TB"}
        printf("%20s %10.2f %s\n",c,csum[c],UNIT)
       }
      UNIT="KB"
      if (tsum>10240) {tsum=tsum/1024;UNIT="MB"}
      if (tsum>10240) {tsum=tsum/1024;UNIT="GB"}
      if (tsum>10240) {tsum=tsum/1024;UNIT="TB"}
      print "========================================="
      printf("%20s %10.2f %s\n","Total of all Clients",tsum,UNIT)
    }'
exit


 

-----Original Message-----
From: veritas-bu-bounces AT mailman.eng.auburn DOT edu
[mailto:veritas-bu-bounces AT mailman.eng.auburn DOT edu] On Behalf Of Sushil
Sent: Tuesday, April 21, 2009 7:53 AM
To: VERITAS-BU AT MAILMAN.ENG.AUBURN DOT EDU
Subject: [Veritas-bu] Total Client Data


Hi Guys,

I am a newbie to netbackup. I have been asked to generate a report which
contains how much data is stored by each client on netbackup. And also
total data stored on netbackup. I have no idea how to get this. hope you
guys will be able to help me out on this...

Thanks
Sushil

+----------------------------------------------------------------------
|This was sent by sushil.gambhir AT gmail DOT com via Backup Central.
|Forward SPAM to abuse AT backupcentral DOT com.
+----------------------------------------------------------------------


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

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