Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unix sync-check of a 3494 silo

Scripting

Unix sync-check of a 3494 silo

by  Chapter11  Posted    (Edited  )
This script does not actually perform any syncing of Networker to a 3494's internal inventory, but will print results of what's not in sync.

Output:
Lines beginning with "SILO" indicate volumes that are in the silo, but not in Networker. Use "nsrjb -a -T <volume>" to correct them.
Lines beginning with "NSRJB" indicate volumes that Networker thinks are in the silo, but in fact are not. "nsrjb -w -T <volume>" should correct this.
Lines beginning with "MMLOCATE" indicate volumes that mmlocate reports as being in the silo, but in fact are not. Use "mmlocate -n <volume> -u <real_location>" to correct this.

[tt]
#!/bin/ksh

# syncinv
# 2001 Jeremy Collins
# as far as licensing applies to a script, the modified BSD license applies.

# Stuff for the local environment
SILLOC="ftwsilo"
# siloloc is the value mmlocate reports for volume that are in the silo
SILOSERIES="[EN]"
# siloseries is a greppable regex. I use both "E" and "N" series in mine.
# if you have only one series, siloseries can be that single letter
LMCP=/dev/lmcp0
# the default value for lmcp is probably sufficient

# you probably won't need to modify the rest of this, unless you care
# to reimplement it. I'm sure it could be done better and faster.

UNIQUE=$$

#echo "Inventorying Silo..."
mtlib -l${LMCP} -qI | grep "^${SILOSERIES}" > /tmp/LIBINV.${UNIQUE}

#echo "Inventorying Legato..."
nsrjb | grep "^........${SILOSERIES}" | sed s/"(A)"/""/g | sed s/"(R)"/""/g > /tmp/LEGINV.${UNIQUE}

#echo "Collecting Legato Location data..."
mmlocate | grep "${SILLOC}" > /tmp/LOCATE.${UNIQUE}

#echo "Comparing Silo inventory with Legato inventory..."
cat /tmp/LIBINV.${UNIQUE} | while read TAPE MISC
do
COUNT=`grep ${TAPE} /tmp/LEGINV.${UNIQUE} | wc -l`
if test ${COUNT} -eq 0
then
#echo "Silo has ${TAPE}, Legato does not"
echo "SILO ${TAPE}"
fi
done

#echo "Comparing nsrjb inventory to Silo..."
cat /tmp/LEGINV.${UNIQUE} | while read SLOT TAPE MISC
do
COUNT=`grep ${TAPE} /tmp/LIBINV.${UNIQUE} | wc -l`
if test ${COUNT} -eq 0
then
#echo "Legato nsrjb has ${TAPE}, but it's not in the silo"
echo "NSRJB ${TAPE}"
fi
done

#echo "Comparing mmlocate data to Silo inventory..."
cat /tmp/LOCATE.${UNIQUE} | while read TAPE MISC
do
COUNT=`grep ${TAPE} /tmp/LIBINV.${UNIQUE} | wc -l`
if test ${COUNT} -eq 0
then
#echo "Legato location of ${TAPE} is silo, but it's not there"
echo "MMLOCATE ${TAPE}"
fi
done

rm /tmp/LIBINV.${UNIQUE}
rm /tmp/LEGINV.${UNIQUE}
rm /tmp/LOCATE.${UNIQUE}
[/tt]
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top