Veritas-bu

[Veritas-bu] Tape Library - Which drives are used and when ?

2005-10-13 11:15:05
Subject: [Veritas-bu] Tape Library - Which drives are used and when ?
From: Mark.Donaldson AT cexp DOT com (Mark.Donaldson AT cexp DOT com)
Date: Thu, 13 Oct 2005 09:15:05 -0600
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_000_01C5D008.9295A5A6
Content-Type: text/plain;
        charset="iso-8859-1"

Nope.

But you can use my handy-dandy report writer for this.  It's attached.

Just run it via cron every 15 min or so (mine is cron'd for "1,16,31,46 * *
* *").  

Other than adding your email address to the "ADDR" variable at the top of
the script, it's self configuring.  More frequent runs gives better
resolution but wider graphs (and the reverse, of course).  It mails the
graph at midnight when the collection file rolls over.

At the bottom, it gives percentage of availability by drive & overall.

Note, if a job starts & ends between sample periods, it's missed.  The
output is purely based on samples.  Once day I'll work out a log scraper
that parses the bptm file but that's far away.  

-Mark



-----Original Message-----
From: veritas-bu-admin AT mailman.eng.auburn DOT edu
[mailto:veritas-bu-admin AT mailman.eng.auburn DOT edu]On Behalf Of Paul
Porcelli
Sent: Thursday, October 13, 2005 7:06 AM
To: veritas-bu AT mailman.eng.auburn DOT edu
Subject: [Veritas-bu] Tape Library - Which drives are used and when ?


Hi folks,
Can I produce a report from Netbackup which will show me which tape
drives were in use, and when,
over a 24 hour period ?

I'm trying to establish individual Tape Drive usage per day.

Many thanks.
Paul


Privileged/Confidential information may be contained in this Email and any
files transmitted 
with it. If you are not the intended recipient you should not retain, copy
or use this Email 
for any purpose or disclose all or part of its contents to any person. If
you have received 
this Email in error please notify the postmaster and sender immediately and
delete this 
Email from your system. 

Opinions, conclusions and other information in this message that do not
relate to the 
official business of Scottish Water ("SW") and / or Scottish Water Solutions
Ltd ("SWS") 
shall be understood as neither given nor endorsed by them. The contents of
Emails sent and 
received by SW and SWS are monitored.

WARNING: Although SW and SWS have taken reasonable precautions to ensure no
viruses or other 
malicious software are present, SW and SWS cannot accept responsibility for
any loss or 
damage arising from the use of this Email or attachments however caused. The
recipient 
should therefore check this Email and any attachments for the presence of
viruses or other 
malicious software.

Scottish Water
www.scottishwater.co.uk
www.scottishwatersolutions.co.uk
postmaster AT scottishwater.co DOT uk


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


------_=_NextPart_000_01C5D008.9295A5A6
Content-Type: application/octet-stream;
        name="drive_graph.sh"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
        filename="drive_graph.sh"

#!/bin/ksh=0A=
=0A=
ADDR=3D"YOU AT YOURDOMAIN DOT COM"=0A=
=0A=
PATH=3D$PATH:/usr/openv/volmgr/bin=0A=
PROGNAME=3D`basename $0`=0A=
=0A=
DDIR=3D/var/tmp=0A=
DBASE=3D${PROGNAME}_datafile=0A=
DFILE=3D$DDIR/$DBASE.`date +%m_%d_%Y`=0A=
OUTF=3D$DDIR/$PROGNAME.out=0A=
=0A=
if [ ! -f $DFILE -o -n "$1" ]=0A=
then=0A=
  # New data collection file. Process previous datafile first=0A=
  if [ -n "$1" ]=0A=
  then=0A=
    lastfile=3D$1=0A=
  else=0A=
    lastfile=3D`ls -tr $DDIR/$DBASE* 2>/dev/null | tail -1`=0A=
  fi=0A=
  if [ -n "$lastfile" ]=0A=
  then=0A=
    [ -f $OUTF ] && rm $OUTF=0A=
    exec >$OUTF 2>&1=0A=
    #Header=0A=
    awk 'BEGIN{HR=3D-1;MN=3D0;printf("  ")} {if ($2=3D=3D0) {if =
($1!=3DHR) {HR=3D$1=0A=
                                         if (HR<10) {printf("0%1d",HR)} =
else {printf("%2d",HR)}=0A=
                                        } else {printf("-")} =0A=
                           }} END {printf("\n")}' $lastfile =0A=
 =0A=
    #Create Graph=0A=
    for drive in `awk '{print $2}' $lastfile| sort -nu`=0A=
    do=0A=
      awk 'BEGIN {HR=3D0;printf("%2s |",'$drive')} =0A=
           {if ($2=3D=3D'$drive') {if ($1!=3DHR) =
{HR=3D$1;printf("|%s",$3)} else {printf("%s",$3)}}}=0A=
           END {printf("|\n")}' $lastfile =0A=
    done =0A=
=0A=
    #Availability Calcs=0A=
    GDA=3D`awk 'BEGIN {sample=3D0;up=3D0}=0A=
         { sample++ ; if ($3=3D=3D"-") {up++}}=0A=
         END {printf ("%3.1f",up/sample*100)}' $lastfile`=0A=
=0A=
    echo "\n## Drive Availability: ${GDA}%" =0A=
    for drive in `awk '{print $2}' $lastfile| sort -nu`=0A=
    do=0A=
      awk 'BEGIN {sample=3D0;up=3D0}=0A=
           {if ($2=3D=3D'$drive') { sample++ ; if ($3=3D=3D"-") =
{up++}}}=0A=
           END {printf("Drive %2s =3D =
%3d%%\t",'$drive',(up/sample)*100)=0A=
                if(('$drive'%4)=3D=3D3) {printf("\n")}}' $lastfile =0A=
    done  =0A=
    =0A=
    echo "\n## Report Done" =0A=
    mailx -s "NB Rpt: Drive Graph: `basename $lastfile|cut -f2 -d.`" =
$ADDR <$OUTF=0A=
=0A=
    if [ -z "$1" ]=0A=
    then=0A=
      #keep history of input & output files=0A=
      [ -f $OUTF.2 ] && mv $OUTF.2 $OUTF.3=0A=
      [ -f $OUTF.1 ] && mv $OUTF.1 $OUTF.2=0A=
      mv $OUTF  $OUTF.1=0A=
      compress $lastfile=0A=
      [ -f $lastfile.2.Z ] && mv $lastfile.2.Z $lastfile.3.Z=0A=
      [ -f $lastfile.1.Z ] && mv $lastfile.1.Z $lastfile.2.Z=0A=
      mv $lastfile.Z   $lastfile.1.Z=0A=
    fi=0A=
  fi=0A=
fi=0A=
#add to current datafile=0A=
if [ -z "$1" ]=0A=
then=0A=
  HR=3D`date +%H`=0A=
  vmoprcmd -d ds | awk '$1~/^[0-9]/ {if ($3~/DOWN/) {print =
'$HR',$1,"D"} else {=0A=
                                   if ($3~/PEND/) {print '$HR',$1,"P"} =
else {=0A=
                                   if ($3~/AVR/)  {print '$HR',$1,"A"} =
else {=0A=
                                   if ($NF=3D=3D"-")  {print =
'$HR',$1,"-"} else {=0A=
                                   print '$HR',$1,"#"}}}}}' >>$DFILE=0A=
fi=0A=
exit=0A=

------_=_NextPart_000_01C5D008.9295A5A6--

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