#!/bin/ksh -p
#
# Explorer Version: 
EXP_VERSION=4.0
#

# Source tools functions
. ${EXP_LIB}/exp_tools

# Run if specified to do so
script=${0##*/}
which_gate_exit storage $script default all

# Check for either SUNWsamfs or SUNWqfs package 

TEXT=`gettext "No LSC installed"`
require "pkginfo -q SUNWsamfs || pkginfo -q SUNWqfs" "${TEXT}"

 
#  Directories that SAM-FS uses

ETCDIR=/etc/opt/SUNWsamfs
get_cmd "/usr/bin/echo \"ETCDIR = ${ETCDIR}\""		samfs/variables
VARDIR=/var/opt/SUNWsamfs
get_cmd "/usr/bin/echo \"VARDIR = ${VARDIR}\""		samfs/variables
USERDIR=/opt/SUNWsamfs/bin
get_cmd "/usr/bin/echo \"USERDIR = ${USERDIR}\""		samfs/variables
EXECDIR=/opt/SUNWsamfs/sbin
get_cmd "/usr/bin/echo \"EXECDIR = ${EXECDIR}\""		samfs/variables
SHFSDIR=/var/opt/SUNWsamfs/sharefsd
get_cmd "/usr/bin/echo \"SHFSDIR = ${SHFSDIR}\""		samfs/variables
CATDIR=/var/opt/SUNWsamfs/catalog
get_cmd "/usr/bin/echo \"CATDIR = ${CATDIR}\""		samfs/variables
FSDDIR=/var/opt/SUNWsamfs/fsd
get_cmd "/usr/bin/echo \"FSDDIR = ${FSDDIR}\""		samfs/variables
FTPDIR=/var/opt/SUNWsamfs/ftp
get_cmd "/usr/bin/echo \"FTPDIR = ${FTPDIR}\""		samfs/variables

#  Default trace directories
TRCDIR=$VARDIR/trace
get_cmd "/usr/bin/echo \"TRCDIR = ${TRCDIR}\""		samfs/variables
TRCTMP=/tmp/$$.trcctls
get_cmd "/usr/bin/echo \"TRCTRMP= ${TRCTMP}\""		samfs/variables

# Fixed location data directories
ARCHDATA="${VARDIR}/archiver"
get_cmd "/usr/bin/echo \"ARCHDATA= ${ARCHDATA}\""	samfs/variables
STAGER_DATA="${VARDIR}/stager"
get_cmd "/usr/bin/echo \"STAGER_DATA= ${STAGER_DATA}\""	samfs/variables

# Gather ${ETCDIR} and ${VARDIR} directories
get_dir recursive "${ETCDIR}"				samfs/${ETCDIR}
get_dir recursive "${VARDIR}"				samfs/${VARDIR}
# Discover log files locations

# Development log files locations
/usr/bin/echo "List DEVLOGS"
DEVLOGS=${VARDIR}/devlog/*
get_cmd "/usr/bin/echo \"DEVLOGS= ${DEVLOGS}\"" 	samfs/variables

# Find the log file locations in the various configuration files
if [ -f /etc/opt/samfs/defaults.conf ]
  then
  /usr/bin/echo "${ETCDIR}/defaults.conf exists."
  if [ -r /etc/opt/samfs/defaults.conf ]
    then
    /usr/bin/echo "${ETCDIR}/defaults.conf is readable."
    LOGIS=`grep LOCAL /etc/opt/samfs/defaults.conf | grep -v "#" | sed -e "s/^.*LOG_//"`
    if [ x$LOGIS = x ]
      then
      LOGIS=local7
    fi
  fi
  else
  LOGIS=local7
fi
/usr/bin/echo "LOGIS value is ${LOGIS}"
# Get the samfs log file.
# Skip non-sam entries with patterns like "local1,...,local7.none".

if [ -f /etc/syslog.conf ]
  then
    SAMLM=`grep -i $LOGIS /etc/syslog.conf | grep -v "#" | grep -v $LOGIS'[^;]*.none'| grep "	"| head -1`
    if [ "X" = "X$SAMLM" ]
      then
        /usr/bin/echo "/etc/syslog.conf entry for sam is missing tab"
        SAMLOG=""
      else
        SAMLOG=`/usr/ccs/bin/m4 /etc/syslog.conf | grep -i ${LOGIS} | \
               nawk '$0 !~ /^#/ && $NF !~ /\/dev/ \
               	&& length && $NF !~ /\*/{print $NF}'`
        /usr/bin/echo ${SAMLOG}
        get_cmd "/usr/bin/tail -1000 ${SAMLOG}"		samfs/${SAMLOG}
    fi
fi

# Determine location of archiver log.
# strip remainder of line when # encountered
if [ -f ${ETCDIR}/archiver.cmd ]
  then
    ARCHLOGS=`sed -e "/#/s/#.*//" < $ETCDIR/archiver.cmd|grep "logfile.*="| sed -e "/logfile/,/logfile/s/^.*= *//"`
fi

# Determine location of recycler log.
# strip remainder of line when # encountered
if [ -f ${ETCDIR}/recycler.cmd ]
  then
    RECLLOGS=`sed -e "/#/s/#.*//" < $ETCDIR/recycler.cmd|grep "logfile.*="| sed -e "/logfile/,/logfile/s/^.*= *//"`
fi

# Determine location of releaser log.
# strip remainder of line when # encountered
if [ -f ${ETCDIR}/releaser.cmd ]
  then
    RELLOG=`sed -e "/#/s/#.*//" < $ETCDIR/releaser.cmd|grep "logfile.*="| sed -e "/logfile/,/logfile/s/^.*= *//"`
fi

# Determine location of stage log.
# strip remainder of line when # encountered
if [ -f ${ETCDIR}/samlogd.cmd ]
  then
    STAGELOG=`sed -e "/#/s/#.*//" < $ETCDIR/samlogd.cmd|grep "logfile.*="| sed -e "/logfile/,/logfile/s/^.*= *//"`
fi

# Determine location of stager log.
# strip remainder of line when # encountered
if [ -f ${ETCDIR}/stager.cmd ]
  then
    STAGER_LOG=`sed -e "/#/s/#.*//" < $ETCDIR/stager.cmd|grep "logfile.*="| sed -e "/logfile/,/logfile/s/^.*= *//"`
fi

# Get trace information
# Create output file from the "samcmd d" command
get_cmd "$EXECDIR/samcmd d"				samfs/samcmd/samcmd-d

#  Determine location of trace files and assign value to a variable

ARCHTRC=`/bin/grep sam-archiverd ${EXP_TARGET}/samfs/samcmd/samcmd-d.out|sed -e 's/sam-archiverd *//'|sed -e 's/^off$//'`
CATTRC=`/bin/grep sam-catserverd ${EXP_TARGET}/samfs/samcmd/samcmd-d.out|sed -e 's/sam-catserverd *//'|sed -e 's/^off$//'`
FSDTRC=`/bin/grep sam-fsd ${EXP_TARGET}/samfs/samcmd/samcmd-d.out|sed -e 's/sam-fsd *//'|sed -e 's/^off$//'`
FTPTRC=`/bin/grep sam-ftpd ${EXP_TARGET}/samfs/samcmd/samcmd-d.out|sed -e 's/sam-ftpd *//'|sed -e 's/^off$//'`
RCYTRC=`/bin/grep sam-recycler ${EXP_TARGET}/samfs/samcmd/samcmd-d.out|sed -e 's/sam-recycler *//'|sed -e 's/^off$//'`
SHFSTRC=`/bin/grep sam-sharefsd ${EXP_TARGET}/samfs/samcmd/samcmd-d.out|sed -e 's/sam-sharefsd *//'|sed -e 's/^off$//'`
STGTRC=`/bin/grep sam-stagerd ${EXP_TARGET}/samfs/samcmd/samcmd-d.out|sed -e 's/sam-stagerd *//'|sed -e 's/^off$//'`

# Echo out the values
get_cmd "/usr/bin/echo \"SAMLOG = ${SAMLOG}\""		samfs/variables
get_cmd "/usr/bin/echo \"ARCHLOGS = ${ARCHLOGS}\""	samfs/variables
get_cmd "/usr/bin/echo \"RECLLOGS = ${RECLLOGS}\""	samfs/variables
get_cmd "/usr/bin/echo \"DEVLOGS = ${DEVLOGS}\""	samfs/variables
get_cmd "/usr/bin/echo \"RELLOG = ${RELLOG}\""		samfs/variables
get_cmd "/usr/bin/echo \"STAGELOG = ${STAGELOG}\""	samfs/variables
get_cmd "/usr/bin/echo \"STAGER_LOG = ${STAGER_LOG}\""	samfs/variables
get_cmd "/usr/bin/echo \"ARCHTRC = ${ARCHTRC}\""	samfs/variables
get_cmd "/usr/bin/echo \"CATTRC = ${CATTRC}\""		samfs/variables
get_cmd "/usr/bin/echo \"FSDTRC = ${FSDTRC}\""		samfs/variables
get_cmd "/usr/bin/echo \"FTPTRC = ${FTPTRC}\""		samfs/variables
get_cmd "/usr/bin/echo \"RCYTRC = ${RCYTRC}\""		samfs/variables
get_cmd "/usr/bin/echo \"SHFSTRC = ${SHFSTRC}\""	samfs/variables
get_cmd "/usr/bin/echo \"STGTRC = ${STGTRC}\""		samfs/variables

# Get the last 1000 lines of the log and trace files
#for FILE in $ARCHLOGS $RECLLOGS $DEVLOGS $RELLOG $STAGELOG $STAGER_LOG $ARCHTRC $CATTRC $FSDTRC $FTPTRC $RCYTRC $SHFSTRC $STGTRC
for FILE in $RECLLOGS $RELLOG $STAGELOG $STAGER_LOG 
do
  if [ -n ${FILE} ]
    then
      /usr/bin/echo "Getting file ${FILE}"
      get_cmd "/usr/bin/tail -1000 ${FILE}"		samfs/${FILE}
    else
      /usr/bin/echo "File ${FILE} does not exist" 
  fi
done

# Get the last 1000 lines of the .grau log files
#get_cmd "/usr/bin/tail -1000 ${VARDIR}/.grau/graulog*"	samfs/${VARDIR}_grau/graulog
get_cmd "/usr/bin/tail -1000 /tmp/.grau"		samfs/tmp/grau

# Gather fs log file
get_cmd "/bin/ls /var/adm/log/fs_fifo_log"		samfs/var/adm/log/fs_fifo_log-ls-l
get_cmd "/bin/ls /var/adm/log/fs_ioctl_log"		samfs/var/adm/log/fs_ictl_log-ls-l


# Get system information
get_cmd "/bin/ls -l /etc/release"			samfs/etc/release-ls-l

# Check for sam_statvfs_bias in /etc/system
get_cmd "/bin/grep sam_statvfs_bias /etc/system"	samfs/system/sam_statvfs_bias-grep

# Patch and Package Information


# Kernel Information
#get_cmd "/bin/ls -l /kernel/drv/sam*"			samfs/kernel/drv_sam\*-ls-l
#get_cmd "/bin/ls -l /kernel/fs/samfs"			samfs/kernel/fs_samfs-ls-l
#get_cmd "/bin/ls -l /kernel/sys/samsys"			samfs/kernel/sys_samsys-ls-l
#get_cmd "/bin/ls -l /kernel/drv/sparcv9/sam*"		samfs/kernel/drv_sparcv9_sam*-ls-l
#get_cmd "/bin/ls -l /kernel/fs/sparcv9/sam*"		samfs/kernel/fs_sparcv9_sam*-ls-l
#get_cmd "/bin/ls -l /kernel/sys/sparcv9/sam*"		samfs/kernel/sys_sparcv9_sam*-ls-l

#get_file "/kernel/drv/samst.conf"			samfs/kernel/drv/
#get_file "/kernel/drv/samrd.conf"			samfs/kernel/drv/
#get_file "/kernel/drv/st.conf"				samfs/kernel/drv/
#get_file "/kernel/drv/dst.conf"			samfs/kernel/drv/

# Device and driver information
get_cmd "/bin/ls -l /dev/rdst*"				samfs/dev/rdst-ls-l
get_cmd "/bin/ls -Ll /dev/rdst*"			samfs/dev/rdst-ls-Ll
get_cmd "/bin/ls -l /dev/dsk/*s2"			samfs/dev/dsk_*2-ls-l
get_cmd "/bin/ls -Ll /dev/dsk/*s2"			samfs/dev/dsk_*2-ls-Ll
get_cmd "/bin/ls -l /dev/rdsk/*s2"			samfs/dev/rdsk_*2-ls-l
get_cmd "/bin/ls -Ll /dev/rdsk/*s2"			samfs/dev/rdsk_*2-ls-Ll

get_cmd "/bin/ls -l /etc/driver_classes"		samfs/etc/driver_classes-ls-l
get_file "/etc/driver_classes"				samfs/etc/
get_cmd "/bin/ls -l /etc/driver_aliases"		samfs/etc/driver_aliases-ls-l
get_file "/etc/driver_aliases"				samfs/etc/

# Get LSC SAMFS information from commands
get_cmd "/bin/ls -lR /opt/SUNWsamfs"			samfs/opt/SUNWsamfs-ls-lR
#get_cmd "/bin/ls -ld ${ETCDIR}"			samfs/etc/opt/SUNWsamfs-ls-ld
#get_cmd "/bin/ls -lLd ${ETCDIR}"			samfs/etc/opt/SUNWsamfs-ls-lLd
#get_cmd "/bin/ls -l ${ETCDIR}"				samfs/etc/opt/SUNWsamfs-ls-l
#get_cmd "/bin/ls -lL ${ETCDIR}"			samfs/etc/opt/SUNWsamfs-ls-lL
#get_cmd "/bin/ls -ld ${VARDIR}"			samfs/var/opt/SUNWsamfs-ls-ld
#get_cmd "/bin/ls -lLd ${VARDIR}"			samfs/var/opt/SUNWsamfs-ls-lLd
#get_cmd "/bin/ls -lL ${VARDIR}"			samfs/var/opt/SUNWsamfs-ls-lL

# Get LSC SAMFS information from files
#get_file "${ETCDIR}/mcf"	 			samfs${ETCDIR}/
#get_file "${ETCDIR}/hosts.sqfs.1"			samfs${ETCDIR}/
#get_file "${ETCDIR}/defaults.conf"			samfs${ETCDIR}/
#get_file "${ETCDIR}/archiver.cmd"			samfs${ETCDIR}/
#get_file "${ETCDIR}/inquiry.conf"			samfs${ETCDIR}/
#get_file "${ETCDIR}/mount.sh"				samfs${ETCDIR}/
#get_file "${ETCDIR}/preview.cmd"			samfs${ETCDIR}/
#get_file "${ETCDIR}/recycler.cmd"			samfs${ETCDIR}/
#get_file "${ETCDIR}/releaser.cmd"			samfs${ETCDIR}/
#get_file "${ETCDIR}/samfs.cmd"				samfs${ETCDIR}/
#get_file "${ETCDIR}/samlogd.cmd"			samfs${ETCDIR}/
#get_file "${ETCDIR}/stager.cmd"			samfs${ETCDIR}/
#get_file "${ETCDIR}/diskvols.conf"			samfs${ETCDIR}/
#get_file "${ETCDIR}/LICENSE.4.0"			samfs${ETCDIR}/
#get_file "${ETCDIR}/LICENSE.dat"			samfs${ETCDIR}/
#
get_file "/opt/SUNWsamfs/include/version.h"		samfs/opt/SUNWsamfs/include/

get_cmd "/bin/grep sam /etc/name_to_sysnum"		samfs/name_to_sysnum_grep

# Modinfo output
get_cmd "/usr/sbin/modinfo | /bin/grep sam | /bin/grep -v sampling"	samfs/modinfo/modinfo_grep-sam-v-sampling
get_cmd "/usr/sbin/modinfo | /bin/grep ' sd '"		samfs/modinfo/modinfo_grep-sd
get_cmd "/usr/sbin/modinfo | /bin/grep ' st '"		samfs/modinfo/modinfo_grep-st

# Storage array info
get_cmd "/usr/sbin/modinfo | /bin/grep fp"		samfs/modinfo/modinfo_grep-fp
get_cmd "/usr/sbin/modinfo | /bin/grep qlc"		samfs/modinfo/modinfo_grep-qlc
get_cmd "/usr/sbin/modinfo | /bin/grep ssd"		samfs/modinfo/modinfo_grep-ssd

#get_file "${EXECDIR}/ar_notify.sh"			samfs${EXECDIR}/
#get_file "${EXECDIR}/inquiry.conf"			samfs${EXECDIR}/
#get_file "${EXECDIR}/dev_down.sh"			samfs${EXECDIR}/
#get_file "${EXECDIR}/save_core.sh"			samfs${EXECDIR}/
#get_file "${EXECDIR}/recycler.sh"			samfs${EXECDIR}/

# Run samset commands
get_cmd "${EXECDIR}/samset"				samfs/samset/samset
get_cmd "${EXECDIR}/samset debug"			samfs/samset/samset-debug
get_cmd "${EXECDIR}/samset devlog all"			samfs/samset/samset-devlog-all

get_cmd "/bin/ls -l /dev/samst"				samfs/dev/samst-ls-l
get_cmd "/bin/ls -Ll /dev/samst"			samfs/dev/samst-ls-Ll
get_cmd "/bin/ls -l /dev/samrd"				samfs/dev/samrd-ls-l

# SANergy info
get_cmd "/bin/ls -l /opt/SANergy/lib"			samfs/opt/SANergy/lib-ls-l
get_cmd "/bin/ls -l /opt/SANergy/lib/sparcv9"		samfs/opt/SANergy/lib_sparcv9-ls-l
get_cmd "/bin/ls -Ll /opt/SANergy/lib"			samfs/opt/SANergy/lib-ls-Ll
get_cmd "/bin/ls -Ll /opt/SANergy/lib/sparcv9"		samfs/opt/SANergy/lib-ls-Ll

#  Gather SAM filesystem information

# Accumulate samfs filesystem mount points
SAMFSMP=`sed -e "/#/s/#.*//" < /etc/vfstab | /bin/awk '$4 == "samfs" { print $3 " "}'`

# accumulate samfs filesystem names
SAMFSES=`sed -e "/#/s/#.*//" < /etc/vfstab | /bin/awk '$4 == "samfs" { print $1 " "}'`

# SAM filesystem info and SAM shared filesystem info
for fs in $SAMFSES
do
   get_cmd "${EXECDIR}/samfsinfo $fs"		samfs/samfsinfo/$fs
   get_cmd "${EXECDIR}/samsharefs $fs"		samfs/samsharefs/$fs
   get_cmd "${EXECDIR}/samsharefs -R $fs"	samfs/samsharefs-R/$fs
   get_cmd "${EXECDIR}/samcmd a $fs"		samfs/samcmd/samcmd-a/$fs
done

# SAM filesystem parameters 
for SAMFS in $SAMFSMP
do
   get_cmd "${EXECDIR}/samcmd N $SAMFS"	samfs/samcmd/samcmd-N/$SAMFS
done

# samu info 
get_cmd "${EXECDIR}/samcmd f"			samfs/samcmd/samcmd-f
get_cmd "${EXECDIR}/samcmd m"			samfs/samcmd/samcmd-m
get_cmd "${EXECDIR}/samcmd p"			samfs/samcmd/samcmd-p
get_cmd "${EXECDIR}/samcmd w"			samfs/samcmd/samcmd-w
get_cmd "${EXECDIR}/samcmd u"			samfs/samcmd/samcmd-u
get_cmd "${EXECDIR}/samcmd r"			samfs/samcmd/samcmd-r
get_cmd "${EXECDIR}/samcmd n"			samfs/samcmd/samcmd-n

# archiver information
get_cmd "/bin/grep wait ${ETCDIR}/archiver.cmd"		samfs/${ETCDIR}/archiver.cmd-grep-wait
get_cmd "${EXECDIR}/archiver -lv"			samfs/${ETCDIR}/archiver-lv
#get_cmd "/bin/ls -ld ${VARDIR}/archiver"		samfs/${VARDIR}/archiver-ls-ld
#get_cmd "/bin/ls -lLd ${VARDIR}/archiver"		samfs/${VARDIR}/archiver-ls-lLd
#get_cmd "/bin/ls -lLa ${VARDIR}/archiver"		samfs/${VARDIR}/archiver-ls--lLa
#get_dir recursive "${ARCHDATA}"				samfs/${ARCHDATA}

# Shared Memory
get_cmd "${EXECDIR}/dmpshm"				samfs/dmpshm

# Stager datadir
#get_cmd "/bin/ls -ld ${STAGER_DATA}"			samfs/${STAGER_DATA}/ls-ld
#get_cmd "/bin/ls -lLd ${STAGER_DATA}"			samfs/${STAGER_DATA}/ls-lLd
#get_cmd "/bin/ls -lLa ${STAGER_DATA}"			samfs/${STAGER_DATA}/ls-lLa
#get_dir recursive "${STAGER_DATA}"			samfs/${STAGER_DATA}

# Samtrace
get_cmd "${EXECDIR}/samtrace -v"			samfs/${EXECDIR}/samtrace-v

# Sam-fsd 
get_cmd "/usr/lib/fs/samfs/sam-fsd"			samfs/usr/lib/fs/samfs/sam-fsd

# samfs stack tracebacks
# verify utilities are available.
if [ -f /usr/proc/bin/pstack -a -f /usr/proc/bin/pflags -a -f /usr/proc/bin/ptree ]
  then # Get pid of sam-fsd process
    SAM_FSD=`/usr/bin/ps -e | /usr/bin/egrep -e sam-fsd | /bin/awk '{print $1}'`
    if [ -n ${SAM_FSD} ]
      then
        get_cmd "/usr/proc/bin/ptree ${SAM_FSD}"	samfs/proc/ptree/sam_fsd.tree.${SAM_FSD}
        for PID in `/bin/cat ${EXP_TARGET}/samfs/proc/ptree/sam_fsd.tree.${SAM_FSD}.out | /bin/awk '{print $1}'`
	do
            get_cmd "/usr/proc/bin/pstack ${PID}"		samfs/proc/pstack/sam_fsd.stack.${PID}
	    get_cmd "/usr/proc/bin/pflags ${PID}"		samfs/proc/pflags/sam_fsd.flags.${PID}
        done
      else
        echo "sam-fsd is not running."
    fi
fi

# Find core files in SUNWsamfs directories
for DIR in ${ETCDIR} ${VARDIR} ${USERDIR} ${EXECDIR}
do
  ONLINE_CORE_FILES=""
  if [ -d ${DIR} ]
    then
      if [ -r ${DIR} -a -x ${DIR} ]
        then
          CORE_FILES=`/bin/find ${DIR} -follow -name "core*" -type f -print`
          for FILE in ${CORE_FILES}
          do
            get_cmd "/bin/ls -tlLd ${FILE}"		samfs/core${FILE}-ls-tlLd
            get_cmd "/bin/file ${FILE}"			samfs/core${FILE}-file
          done
      fi
  fi
  if [ X${CORE_FILES} != X ]
    then
      ONLINE_CORE_FILES="${ONLINE_CORE_FILES} ${CORE_FILES}"
  fi
done

# Gather process information on those core files
if [ `uname -r` != "5.6" -a `uname -r` != "5.7" ]
  then
    if [ -f /usr/proc/bin/pstack -a -f /usr/proc/bin/pflags ]
      then
        for CORE in ${ONLINE_CORE_FILES}
        do
          "get_cmd /usr/proc/bin/pstack ${CORE}"		samfs/core/pstack_${CORE}
          "get_cmd /usr/proc/bin/pflags ${CORE}"		samfs/core/pflags_${CORE}
        done
    fi
fi

# Gather jre version 
if [ -r /opt/SUNWsamfs/jre/bin/jre -a -x /opt/SUNWsamfs/jre/bin/jre ]
  then
    get_cmd "/opt/SUNWsamfs/jre/bin/jre -v"			samfs/opt/SUNWsamfs/jre/bin/jre-v
fi

# Parse the mcf file to determine where the tape catalog is.
lineno=0
exec<${ETCDIR}/mcf
while read eqid eqord eqtype famset state additional
do
  # Strip comments
  case ${eqid} in
  \#*)
         continue;;
  esac

  if [ X != X${additional} ]
    then
      catpath=${additional}
      catp1=`echo ${catpath}} | cut -c1`
      if [ X${catp1} != "X/" ] 
        then catpath=${CATDIR}/${additional}
      fi
    else
      catpath=${CATDIR}/${famset}
  fi
  lineno=`expr ${lineno} + 1`
  case ${eqtype} in
    'ma'|'ms'|'md'|'mm'|'mr'|'gx'|'rd'|'sc'|'ss'|'z?')
       ;;
    'rb'|'hp'|'cy'|'dm'|'ds'|'me'|'ac'|'eb'|'ad'|'a1'|'a2'|'sl'|'s9'|'ic'|'fj'|'gr'|'im'|'sk')
       get_cmd "/opt/SUNWsamfs/sbin/dump_cat -V ${catpath}"		samfs/dump_cat/${eqtype}_dump_cat-V
       ;;
    'hy')
       hist_cat=${catpath}
       get_cmd "/opt/SUNWsamfs/sbin/dump_cat -V ${catpath}"		samfs/dump_cat/${eqtype}_dump_cat-V
       get_cmd "/opt/SUNWsamfs/sbin/dump_cat -V ${catpath}"		samfs/dump_cat/${eqtype}_historian_dump_cat-V
       ;;
    'od'|'wo'|'mo'|'mf'|'tp'|'lt'|'st'|'vt'|'dt'|'fd'|'se'|'sg'|'d3'|'d2'|'xt'|'ib'|'i7'|'so'|'at')
       catpath=${CATDIR}/man${eqord}
       get_cmd "/opt/SUNWsamfs/sbin/dump_cat -V ${catpath}"		samfs/dump_cat/${eqtype}_dump_cat-V
       ;;
    'default')
       /usr/bin/echo "Unknown equipment type" >> samfs/dump_cat/${eqtype}_unknown_equipment_type
       ;;
    *)
       /usr/bin/echo "Unknown equipment type" >> samfs/dumpcat/${eqtype}_unknown_equipment_type
       ;;
  esac
done

