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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple explorers

Status
Not open for further replies.

techincaladmin

Technical User
Jul 5, 2009
26
0
0
QA
can anyone guide me for a script which can run ./run-griffon on multiple explorers in /opt/SUNWexplo/output/ directory. Right now it is saying me cant deal with many. Run by hand.. Thanks in advance
 
You mean something like this?

Code:
for f in explo*.gz ; do ./run-griffon $f ; done

What is griffon?

Annihilannic.
 
Griffon is a tool inside EIS-DVD for generating report against Sun explorers... including patch details etc
 
nope.. i m still missing the trick, it is reporting cant deal with many, as i have moved around 28 explorers inside /opt/SUNWexplo/output/.. for single explorer inside /opt/SUNWexplo/output, it is working fine.. :(
 
Well, I don't have a copy of griffon and it doesn't appear to be available for public download anywhere obvious, so I can't try it. Perhaps examine the run-griffon script (if it is a script) and see if it can be modified to your requirements, or if you can find the actual command it runs and use that in a loop like the one I suggested.

Annihilannic.
 

#!/bin/sh
#
# Script to make running of GRIFFON easier
# Intended for use where a single explorer output exists.
# JAN05: Add checks that Instinfo was run etc.
# MAR05: Minor change to reflect tarball change.
# JAN06: Ensure correct running with -q|-Q EQR option

HOMEDIR=`pwd`
BASEDIR=/tmp
GRIFFON=$BASEDIR/griffon
TEMP=/tmp/EIS-$$
EQR=""

Usage()
{
echo "usage: run-griffon.sh [-q]"
}

#
# Analyse parameters
#
#echo "all ARGS=$*"

while [ X$1 != "X" ]
do
case $1 in
-q|-Q) EQR='-Q';;
-*) Usage; exit 2;;
*) ;;
esac
shift
done



#
# Kick off with a few sanity checks.
#


#
# Check to see if serial number is not blank
#
if [ -f /etc/opt/SUNWexplo/default/explorer ]
then
rm -rf $TEMP
grep "^EXP_SERIAL" </etc/opt/SUNWexplo/default/explorer | sed "s/`hostid`//" >$TEMP
. $TEMP
if [ "X${EXP_SERIAL_}" = "X" ]
then
echo ""
echo "***************************************************************************"
echo "* It looks as if the system serial number is not in the explorer defaults *"
echo "* This may affect the compliancy numbers for this installation *"
echo "* Please rectify this via explorer -g *"
echo "* *"
echo "* Then re-run the data collector again via explorer -i *"
echo "***************************************************************************"
echo ""
sleep 5
echo ""
echo ""
fi
fi


#
# Examine if the Metacluster is SUNWCreq as in Bug 5026727
#
if [ ! -f /var/sadm/system/admin/CLUSTER ]
then
echo ""
echo "Cannot find file /var/sadm/system/admin/CLUSTER - ABORT!"
exit 1
else
if [ `cat /var/sadm/system/admin/CLUSTER` = "CLUSTER=SUNWCreq" ]
then
echo ""
echo " *****************************************************************************"
echo " * Examining the contents of file /var/sadm/system/admin/CLUSTER... *"
echo " * The Metacluster used in the installation seems to be SUNWCreq. *"
echo " * NOTE: SUNWCreq is minimum; generally SUNWCall or SUNWCXall are used. *"
echo " * If Solaris had been installed from CD-ROM this may be due to Bug 5026727. *"
echo " * If falsely set to SUNWCreq you may get spurious errors from SunCheckup. *"
echo " *****************************************************************************"
sleep 5
echo ""
echo ""
fi
fi

echo ""


#
# Change directories
#
if [ ! -d /opt/SUNWexplo/output ]
then
echo "Directory /opt/SUNWexplo/output not found - aborting"
exit 1
fi

cd /opt/SUNWexplo/output

#
# Collect the explorer output directories
#

rm -f /tmp/explorer-list
touch /tmp/explorer-list
for file in explorer*
do
if [ -d $file ]
then
echo $file >>/tmp/explorer-list
fi
done

if [ `cat /tmp/explorer-list | wc -l` -eq 0 ]
then
echo "Could not find any explorer directories in /opt/SUNWexplo/output"
exit 1
fi

if [ `cat /tmp/explorer-list | wc -l` -eq 1 ]
then
EXPLORER=`cat /tmp/explorer-list`
echo "Single explorer output found: $EXPLORER"
else
echo "Several explorers found: I can only deal with one!"
echo "Please run Griffon by hand."
exit 1
fi


#
# Check to ensure that explorer ran with instinfo option
#
if [ ! -f /opt/SUNWexplo/output/${EXPLORER}/etc/opt/SUNWexplo/instinfo/install_info ]
then
echo ""
echo ""
echo ""
echo " **************************************************************************"
echo " * It looks as if this explorer was run without the INSTINFO (-i) option *"
echo " * This may affect the compliancy numbers for this installation *"
echo " * *"
echo " * If this is a fresh installation please do NOT continue with Griffon *"
echo " * Please re-run the data collector via explorer -i & then Griffon *"
echo " **************************************************************************"
echo ""
echo "Interrupt NOW to stop the run of Griffon........."
echo "Waiting 5 seconds..."
echo ""
sleep 5
fi

#
# Install the Griffon runtime
#

cd $HOMEDIR
echo "Installing Griffon..."
if [ -d $GRIFFON ]; then
/usr/bin/rm -rf $GRIFFON
fi
mkdir $GRIFFON
gzcat griffon*gz | (cd $GRIFFON; tar xBpf -)

#
# Start Griffon
#
echo ""
echo "Starting Griffon..."
echo ""
cd $GRIFFON
if [ ! -d $GRIFFON/output ]; then
mkdir $GRIFFON/output
else
/usr/bin/rm -f $GRIFFON/output/*
fi
./griffon $EQR -o $GRIFFON/output/griffon -e /opt/SUNWexplo/output/$EXPLORER
java -classpath $GRIFFON/xalan/bin/ -jar $GRIFFON/xalan/bin/xalan.jar \
-XSL $GRIFFON/xsl/t.default.master.xsl \
-IN $GRIFFON/output/griffon.master.xml \
-OUT /tmp/griffon_report.txt

echo "The results are in /tmp/griffon_report.txt"

# copy EQR files if necessary
if [ ! -z "$EQR" ]
then # EQR was requested ...
# copy the necessary file
cp -p ${GRIFFON}/output/griffon.eis_quality.xml /tmp
cp -p ${GRIFFON}/output/griffon.eis_quality_report.txt /tmp

# show output location
echo "The EQR XML is in /tmp/griffon.eis_quality.xml"
echo "The EQR Report is in /tmp/griffon.eis_quality_report.txt"
fi

#
# Delete Griffon
#
echo ""
echo "Deleting Griffon..."
cd $HOMEDIR
/usr/bin/rm -rf $GRIFFON

 
nope..it is the basic script for Griffon inside EIS-DVD tools folder!! use to report me
"Several explorers found: I can only deal with one!"
"Please run Griffon by hand."
all the time..!!
 
Firstly I would install griffon once, instead of every time the script runs, e.g.

Code:
mkdir /usr/local/griffon
gzcat griffon*gz | (cd /usr/local/griffon; tar xBpf -)

Then you could use something like this to run it:

Code:
for EXPLORER in /opt/SUNWexplo/output/*
    /usr/local/bin/griffon -o /tmp/output/griffon -e $EXPLORER 
    java -classpath /usr/local/griffon/xalan/bin/ -jar /usr/local/griffon/xalan/bin/xalan.jar \
        -XSL /usr/local/griffon/xsl/t.default.master.xsl \
        -IN /usr/local/griffon/output/griffon.master.xml \
        -OUT /tmp/griffon_report_$(basename $EXPLORER).txt
done

I have no way of testing this though so you will have to experiment.

Annihilannic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top