[Veritas-bu] Slots available in a library
2004-04-23 15:24:38
Here's my script for it:
#!/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.*3" $NBPATH/netbackup/version` -ge 1 ]
then
#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}'`
else
#v4.5
maxslot=`vmchange -res -robot_info -rn $robnum -rt $robtype -rh
$robhost|\
awk '{print $5}'`
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
-----Original Message-----
From: Yosifovski, Tammy [mailto:Tammy.Yosifovski AT usfc DOT com]
Sent: Friday, April 23, 2004 12:46 PM
To: veritas-bu AT mailman.eng.auburn DOT edu
Subject: [Veritas-bu] Slots available in a library
I am looking for a Netbackup 4.5.3 (Unix and Windows) command that would
produce a list of which tapes slots are available/do not contain tapes.
Thank you for your help!!
Tammy Yosifovski
----------------------------------------------------------------------------
---------
This e-mail is the exclusive, private and confidential property of the
sender. The
information contained in it is intended solely for the use of the sender and
the
intended recipient. If you are not the intended recipient you are hereby
advised that
any unauthorized disclosure, copying, distribution or the taking of any
action in
reliance on the contents of this message is strictly prohibited. If you have
received
this e-mail in error, please notify us immediately by telephone (call the
USF
Corporation Technical Support Center at 1-800-753-4563) and then destroy
this
document and any copies in any form immediately. Finally, the recipient
should
check this email and any attachments for the presence of viruses. USF
Corporation
accepts no liability for any damage caused by any virus transmitted by this
email.
----------------------------------------------------------------------------
---------
|
|
|