[Veritas-bu] Available slots
2003-10-07 15:01:02
If course, it's never that easy. 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.*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
-----Original Message-----
From: kdeems AT parker DOT com [mailto:kdeems AT parker DOT com]
Sent: Tuesday, October 07, 2003 12:32 PM
To: veritas-bu AT mailman.eng.auburn DOT edu
Subject: [Veritas-bu] Available slots
Does anyone know the Veritas command which counts the empty slots in a tape
silo? We have a L700, I want to create a script which counts the
available slots and emails the results so our operators wont try to
overload the silo.
Thanks
-----------------------------------------
"PLEASE NOTE: The preceding information may be confidential or privileged.
It only should be used or disseminated for the purpose of conducting
business with Parker. If you are not an intended recipient, please notify
the sender by replying to this message and then delete the information from
your system. Thank you for your cooperation."
_______________________________________________
Veritas-bu maillist - Veritas-bu AT mailman.eng.auburn DOT edu
http://mailman.eng.auburn.edu/mailman/listinfo/veritas-bu
|
|
|