#!/bin/ksh -p
# $Id: //depot/stable/explorer/tools/var#3 $
#
# Explorer Version:
EXP_VERSION=4.0
#

# Source tools functions
. ${EXP_LIB}/exp_tools

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

get_cmd  "/bin/ls -ld /var"			var/ls-ld
get_cmd  "/bin/ls -ld /var/adm"			var/adm-ld
get_cmd  "/bin/ls -ld /var/sadm"		var/sadm-ld
get_cmd  "/bin/ls -l  /var/yp/binding"		var/yp_binding_ls-l
get_cmd  "/bin/ls -l  /var/tmp"			var/tmp_ls-l
get_file "/var/sadm/softinfo/INST_RELEASE"	var/
get_file "/var/sadm/install/contents"		var/
get_file "/var/sadm/system/admin/CLUSTER"	var/

# Collect vts here until vts collector available
get_file "/var/opt/SUNWvts/logs/sunvts.info" var/

# /var/log can be too large, uncomment if needed
# get_dir recursive /var/log var/log

# Get install info if available
get_file "/var/sun/install/INFO/install_info"	var/instinfo/
get_file "/var/sun/EIS-CD.log"			var/sun/
get_file "/var/sun/GOLD-CD.log"			var/sun/
get_dir recursive /var/sun/install-ORIG		var/sun/install-ORIG

# Get the crontabs
#get_file "/var/spool/cron/crontabs/*" var/cron/

for i in `echo ${EXP_CRON_WHICH:=adm,lp,root,sys,uucp} | sed -e 's/,/ /g'`
do
	get_file "/var/spool/cron/crontabs/$i"	var/cron
done

# Get a directory listing of the crontabs dir
get_cmd "/bin/ls -la /var/cron"			var/cron/

# Get the last 10000 lines of the log and get a listing
get_cmd "/bin/tail -10000 /var/cron/log"	var/cron/log/
get_cmd "/bin/ls -l /var/cron/log"		var/cron/log/

# Get the /var/ntp directory and a listing
get_cmd "/bin/ls -l /var/ntp"			var/ntp
get_dir recursive /var/ntp			var/ntp

# Get any SSE notes
get_dir recursive /var/sun/include		var/sse

# Get Solaris Security Toolkit Information
if [[ -d /var/opt/SUNWjass ]]
then
	for TIMESTAMP in `ls -1 /var/opt/SUNWjass/run|cut -f1`
	do
		get_file "/var/opt/SUNWjass/run/$TIMESTAMP/jass-install-log.txt"     var/jass/jass-install-log.$TIMESTAMP.txt
	done
fi
