Veritas-bu

[Veritas-bu] Empty Slots.............

2003-04-04 14:42:44
Subject: [Veritas-bu] Empty Slots.............
From: Mark.Donaldson AT experianems DOT com (Donaldson, Mark)
Date: Fri, 4 Apr 2003 12:42:44 -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_01C2FAE2.5CF024B0
Content-Type: text/plain

This will list all the empty slots from the command line (Note: it does a
version lookup for v3.4 or 4.5 & adjusts for both).  Run it on your master
server (or, more accurately, your volume database host).  Your other query
is farther down the page...

> cat ident_empty_slots
#!/bin/ksh

NBPATH=/usr/openv
export PATH=$PATH:$NBPATH/volmgr/bin

PROGNAME=`basename $0`
TPCONFIG=/tmp/$PROGNAME.$$.tpconfig


tpconfig -l >$TPCONFIG

echo "Robot\tSlot\n-----\t-------" >&2

#Get list of robots
roblist=`awk '$1=="robot" {print $2}' $TPCONFIG| sort -u`
for robnum in $roblist
do
  #Get robot type & host
  robtype=`awk '$1=="robot" && $2=='$robnum' {print $4}' $TPCONFIG | \
           tr '[A-Z]' '[a-z]'`
  robhost=`hostname`

  #query for max number of library slots (version specific)
  if [ `grep -c "^VERSION.*4\.5" $NBPATH/netbackup/version` -ge 1 ]
  then
    #v4.5
    maxslot=`vmchange -res -robot_info -rn $robnum -rt $robtype -rh
$robhost|\
             awk '{print $5}'`
  else
    #v3.X
    robaddr=`awk '$1=="robot" && $2=='$robnum' {print $NF}' $TPCONFIG `
    maxslot=`echo "mode" | tldtest -r $robaddr | tr ',' "\012" | tr -d ' ' |
\
             awk -F= '$1=="Numberstorageelements" {print $2}'`
  fi

  count=1
  for fullslot in `vmquery -w -rn $robnum | \
          awk '$9~/[0-9]/ {print $9}' | sort -n`
  do
    while [ $count -lt $fullslot ]
    do
      echo "$robnum\t$count"
      count=`expr $count + 1`
    done
    count=`expr $count + 1`
  done
  while [ $count -le $maxslot ]
  do
    echo "$robnum\t$count"
    count=`expr $count + 1`
  done
done
[ -f $TPCONFIG ] && rm -f $TPCONFIG
exit

---------

The second question is much easier.  Tapes in the libraries is:

> cat ident_library_tapes
#!/bin/sh

echo "Robot\tSlot\tTape\n-----\t----\t------" >&2

/usr/openv/volmgr/bin/vmquery -w -a | \
     awk 'NR>3 && $9!="-" {print $8 "\t" $9 "\t" $1}'
exit


HTH - Mark



-----Original Message-----
From: Joseph Despres [mailto:jdespres AT csc DOT com]
Sent: Friday, April 04, 2003 11:36 AM
To: veritas-bu AT mailman.eng.auburn DOT edu
Subject: [Veritas-bu] Empty Slots.............



Background...........  3 PowderHorn Silos, acsls 6.01, netbackup 3.4_1

Question..................  At the command line:  How would I find out
howmany empty slots there are available ?

                                      At the command line:  How would I
list what tapes are in the silo's.....?

Thanks

Joe Despres


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

------_=_NextPart_001_01C2FAE2.5CF024B0
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] Empty Slots.............</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=3D2>This will list all the empty slots from the command =
line (Note: it does a version lookup for v3.4 or 4.5 &amp; adjusts for =
both).&nbsp; Run it on your master server (or, more accurately, your =
volume database host).&nbsp; Your other query is farther down the =
page...</FONT></P>

<P><FONT SIZE=3D2>&gt; cat ident_empty_slots</FONT>
<BR><FONT SIZE=3D2>#!/bin/ksh</FONT>
</P>

<P><FONT SIZE=3D2>NBPATH=3D/usr/openv</FONT>
<BR><FONT SIZE=3D2>export PATH=3D$PATH:$NBPATH/volmgr/bin</FONT>
</P>

<P><FONT SIZE=3D2>PROGNAME=3D`basename $0`</FONT>
<BR><FONT SIZE=3D2>TPCONFIG=3D/tmp/$PROGNAME.$$.tpconfig</FONT>
</P>
<BR>

<P><FONT SIZE=3D2>tpconfig -l &gt;$TPCONFIG</FONT>
</P>

<P><FONT SIZE=3D2>echo &quot;Robot\tSlot\n-----\t-------&quot; =
&gt;&amp;2</FONT>
</P>

<P><FONT SIZE=3D2>#Get list of robots</FONT>
<BR><FONT SIZE=3D2>roblist=3D`awk '$1=3D=3D&quot;robot&quot; {print =
$2}' $TPCONFIG| sort -u`</FONT>
<BR><FONT SIZE=3D2>for robnum in $roblist</FONT>
<BR><FONT SIZE=3D2>do</FONT>
<BR><FONT SIZE=3D2>&nbsp; #Get robot type &amp; host</FONT>
<BR><FONT SIZE=3D2>&nbsp; robtype=3D`awk '$1=3D=3D&quot;robot&quot; =
&amp;&amp; $2=3D=3D'$robnum' {print $4}' $TPCONFIG | \</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
tr '[A-Z]' '[a-z]'`</FONT>
<BR><FONT SIZE=3D2>&nbsp; robhost=3D`hostname`</FONT>
</P>

<P><FONT SIZE=3D2>&nbsp; #query for max number of library slots =
(version specific)</FONT>
<BR><FONT SIZE=3D2>&nbsp; if [ `grep -c &quot;^VERSION.*4\.5&quot; =
$NBPATH/netbackup/version` -ge 1 ]</FONT>
<BR><FONT SIZE=3D2>&nbsp; then</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp; #v4.5</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp; maxslot=3D`vmchange -res =
-robot_info -rn $robnum -rt $robtype -rh $robhost|\</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp; awk '{print $5}'`</FONT>
<BR><FONT SIZE=3D2>&nbsp; else</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp; #v3.X</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp; robaddr=3D`awk =
'$1=3D=3D&quot;robot&quot; &amp;&amp; $2=3D=3D'$robnum' {print $NF}' =
$TPCONFIG `</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp; maxslot=3D`echo &quot;mode&quot; =
| tldtest -r $robaddr | tr ',' &quot;\012&quot; | tr -d ' ' | \</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp; awk -F=3D '$1=3D=3D&quot;Numberstorageelements&quot; {print =
$2}'`</FONT>
<BR><FONT SIZE=3D2>&nbsp; fi</FONT>
</P>

<P><FONT SIZE=3D2>&nbsp; count=3D1</FONT>
<BR><FONT SIZE=3D2>&nbsp; for fullslot in `vmquery -w -rn $robnum | =
\</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; awk =
'$9~/[0-9]/ {print $9}' | sort -n`</FONT>
<BR><FONT SIZE=3D2>&nbsp; do</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp; while [ $count -lt $fullslot =
]</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp; do</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo =
&quot;$robnum\t$count&quot;</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; count=3D`expr $count =
+ 1`</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp; done</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp; count=3D`expr $count + 1`</FONT>
<BR><FONT SIZE=3D2>&nbsp; done</FONT>
<BR><FONT SIZE=3D2>&nbsp; while [ $count -le $maxslot ]</FONT>
<BR><FONT SIZE=3D2>&nbsp; do</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp; echo =
&quot;$robnum\t$count&quot;</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp; count=3D`expr $count + 1`</FONT>
<BR><FONT SIZE=3D2>&nbsp; done</FONT>
<BR><FONT SIZE=3D2>done</FONT>
<BR><FONT SIZE=3D2>[ -f $TPCONFIG ] &amp;&amp; rm -f $TPCONFIG</FONT>
<BR><FONT SIZE=3D2>exit</FONT>
</P>

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

<P><FONT SIZE=3D2>The second question is much easier.&nbsp; Tapes in =
the libraries is:</FONT>
</P>

<P><FONT SIZE=3D2>&gt; cat ident_library_tapes</FONT>
<BR><FONT SIZE=3D2>#!/bin/sh</FONT>
</P>

<P><FONT SIZE=3D2>echo =
&quot;Robot\tSlot\tTape\n-----\t----\t------&quot; &gt;&amp;2</FONT>
</P>

<P><FONT SIZE=3D2>/usr/openv/volmgr/bin/vmquery -w -a | \</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp; awk 'NR&gt;3 &amp;&amp; =
$9!=3D&quot;-&quot; {print $8 &quot;\t&quot; $9 &quot;\t&quot; =
$1}'</FONT>
<BR><FONT SIZE=3D2>exit</FONT>
</P>
<BR>

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

<P><FONT SIZE=3D2>-----Original Message-----</FONT>
<BR><FONT SIZE=3D2>From: Joseph Despres [<A =
HREF=3D"mailto:jdespres AT csc DOT com">mailto:jdespres AT csc DOT 
com</A>]</FONT>
<BR><FONT SIZE=3D2>Sent: Friday, April 04, 2003 11:36 AM</FONT>
<BR><FONT SIZE=3D2>To: veritas-bu AT mailman.eng.auburn DOT edu</FONT>
<BR><FONT SIZE=3D2>Subject: [Veritas-bu] Empty =
Slots.............</FONT>
</P>
<BR>
<BR>

<P><FONT SIZE=3D2>Background...........&nbsp; 3 PowderHorn Silos, acsls =
6.01, netbackup 3.4_1</FONT>
</P>

<P><FONT SIZE=3D2>Question..................&nbsp; At the command =
line:&nbsp; How would I find out</FONT>
<BR><FONT SIZE=3D2>howmany empty slots there are available ?</FONT>
</P>

<P><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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp; At the command line:&nbsp; How would I</FONT>
<BR><FONT SIZE=3D2>list what tapes are in the silo's.....?</FONT>
</P>

<P><FONT SIZE=3D2>Thanks</FONT>
</P>

<P><FONT SIZE=3D2>Joe Despres</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_01C2FAE2.5CF024B0--

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