#! /bin/ksh
#
# @(#) Revision: 4.2.2 Date: 07/05/98
#
##########################################################################
#
# NO WARRANTIES OF ANY KIND ARE EXPRESSED OR IMPLIED FOR THE USE
# OF THIS SCRIPT OR THE SUITABLITY OF THE INFORMATION COLLECTED
# FOR ANY PURPOSE.
#
##########################################################################
#
# This script may be distributed freely however, it is not to be used
# for commercial purposes without the consent of the author.
# eMail sean@hhinsight.com for information
#
##########################################################################
#
# This script collects system configuration information for Hewlett
# Packard 9000/800/700 series servers running HP-UX 10.x.
# It also works reasonably well for 9.x though some of the additional
# functionality was not configured or tested for 9.x. -Caveat Emptor-
# This script must be run as root and should be run when the system is
# quiet.
#
##########################################################################
#
# Revision History
#
# 05/11/98 Updated to comply with current O/S -wsh
# Added revision history -wsh
# Modified default output to /tmp/.collect -wsh
#
# 05/12/98 Added processor speed detection -wsh
# Added additional functionality -wsh
#
# 05/13/98 Removed page breaks and superflous blank space -wsh
# Fixed "empty file" error -wsh
# Added additional functionality -wsh
# Added test for NIS -wsh
# Fixed "lanscan" duplicity -wsh
#
# 05/15/98 Corrected (some) 9.x command path errors and tests -wsh
# Added test for sysmap fragmentation (panic) in HP-UX 10.20 -wsh
#
# 05/16/98 Added disk space summary -wsh
# Added test for year2000.o (Y2K lib.c patch) -wsh
#
# 06/11/98 Version update, major changes -wsh
# Added support for output options -wsh
# Cleaned up comments -wsh
# Re-worked tests and functions -wsh
# Added additional funtionality and error checking -wsh
# "tweaked" error checking & signal handling a bit more -wsh
#
# 06/12/98 Fixed bug in parsing lp options -wsh
# Fixed bug in parsing file options (duh) -wsh
#
# 07/01/98 Added calculation for physical memory -wsh
#
# 07/03/98 Trimmed redundant information -wsh
# Modified allocated disk space calculation -wsh
#
# 07/05/98 Cleanup, cleanup, cleanup -wsh
# Added physical disk space calculation -wsh
# Changed file listing(s) for quicker customization -wsh
# Added Summary mode (-s) -wsh
#
###################################################################
# DEFINE FUNCTIONS
###################################################################
###################################################################
# Clean up temporary files
###################################################################
#
clean ()
{
#
if [[ -a $outfile ]]; then
rm $outfile 2> /dev/null
fi
tmpfile=/tmp/collect.tmp
tmpfile1=/tmp/collect1.tmp
if [[ -a $tmpfile ]]; then
rm $tmpfile 2> /dev/null
fi
echo
}
#
###################################################################
# Defines the interactive menu
###################################################################
#
report_menu ()
#
{
while true
do
clear
echo
echo " 1. Tape device"
echo " 2. eMail to a user"
echo " 3. Printer"
echo " 4. Named file"
echo "
Select an output option or [q]uit ==> c"
read selection
case $selection in
1) echo "Tape Option"
sleep 2
;;
2) echo "eMail Option"
sleep 2
;;
3) echo "Printer Option"
sleep 2
;;
4) echo "Named file Option"
sleep 2
;;
[Qq]*) break
;;
*) echo "aaa
Invalid selection, please select 1-4 or [q]uit"
sleep 2
continue
;;
esac
done
}
#
##########################################################################
# HOLD SECTION FOR MODS
##########################################################################
#
#
#
#
#
#
#
#
#
#
#
##########################################################################
# List kernel information.
##########################################################################
#
kernel_info ()
#
{
echo "
Kernel Information
" >> $outfile
if [ -x /usr/contrib/bin/prconf ]; then
echo "System Parameters
" >> $outfile
/usr/contrib/bin/prconf | pr -t -o5 >> $outfile
fi
if [ $type = 7 -o $type = 8 ]; then
echo "Configured System Drivers
" >> $outfile
/etc/lsdev | pr -t -o5 >> $outfile
echo >> $outfile
fi
if [ $rev -ge 10 -o $type = 8 ];then
echo "System Parameters
" >> $outfile
/usr/sbin/sysdef >> $outfile
echo >> $outfile
fi
log=/tmp/update.log
if [ -f $log ]; then
echo "Configuration Files
" >> $outfile
size=`ll $log | awk '{ print $5 }'`
if [ $size -gt 5000 ]; then
n=`grep -n "BEGINNING UPDATE PROGRAM" $log | tail -1 | cut -d: -f1`
echo "Update Log
" >> $outfile
tail -n +$n $log | pr -t -o5 >> $outfile
else
echo "No update log found.
"
fi
fi
}
#
##########################################################################
# Get swap information
##########################################################################
#
swap_info ()
#
{
if [ $rev -ge 9 -a ( $type = 8 -o $type = 7 ) ]; then
echo "Swap Information
" >> $outfile
/etc/swapinfo -mt | pr -t -o5 >> $outfile
fi
if [ $rev -ge 8 -a $type = 8 ]; then
if [ -x /usr/contrib/bin/swapinfo ]; then
echo "Swap Information
" >> $outfile
/usr/contrib/bin/swapinfo | pr -t -o5 >> $outfile
fi
fi
echo >> $outfile
}
#
##########################################################################
# Lists the contents of the specified network files.
##########################################################################
#
net_files ()
#
{
echo "Network Files
" >> $outfile
netfiles=""
######################################
# Input list of files here.
######################################
for netfiles in `cat /etc/services
/etc/protocols
/etc/resolv.conf
/etc/exports
/etc/nsswitch.conf
/etc/named.boot
EOF`
do
if [ -f $netfiles ]; then
echo "Contents of: $netfiles
" >> $outfile
cat $netfiles | pr -t -o5 >> $outfile >> $1
echo >> $outfile
else
echo "NOTE:
$netfiles not found.
" >> $outfile
fi
done
make_end Network Files >> $outfile
}
#
##########################################################################
# Lists the contents of the specified system files.
##########################################################################
#
list_files ()
#
{
file_name=""
######################################
# Input list of files here.
######################################
echo "System Files
" >> $outfile
for file_name in `cat /etc/fstab
/etc/profile
/etc/PATH
/etc/MANPATH
/etc/shells
EOF`
do
if [ -f $file_name ]; then
echo "Contents of: $file_name
" >> $outfile
pr -t -o5 /$file_name >> $outfile
echo >> $outfile
else
echo "NOTE:
$file_name not found.
" >> $outfile
fi
done
}
#
##########################################################################
# Lists the contents of the specified security files.
##########################################################################
#
secur_files ()
#
{
echo "Security Files
" >> $outfile
secfiles=""
######################################
# Input list of files here.
######################################
for secfiles in `cat /usr/adm/inetd.sec
~root/.rhosts
/etc/ftpusers
/var/adm/cron/at.allow
/var/adm/cron/cron.allow
EOF`
do
if [ -f $secfiles ]; then
echo "Contents of: $secfiles
" >> $outfile
pr -t $secfiles >> $outfile
echo >> $outfile
fi
done
}
#
##########################################################################
# Get io config from kernel
##########################################################################
#
io_config ()
#
{
echo "IO Information
" >> $outfile
if [ $rev -ge 8 -a $type = 8 ] || [ $rev -ge 10 ]; then
echo "Hardware Scan (usable)
" >> $outfile
echo >> $outfile
/etc/ioscan -fu | pr -t -o5 >> $outfile
echo >> $outfile
echo "Kernel Scan
" >> $outfile
/etc/ioscan -k | pr -t -o5 >> $outfile
echo >> $outfile
else
if [ -x /usr/contrib/bin/io ]; then
echo "Kernel Scan
" >> $outfile
/usr/contrib/bin/io | pr -t -o5 >> $outfile
fi
if [ -x /usr/contrib/bin/spuscan ]; then
echo "Hardware Scan
" >> $outfile
/usr/contrib/bin/spuscan | pr -t -o5 >> $outfile
fi
fi
make_end IO Info >> $outfile
}
#
##########################################################################
# Get startup/shutdown info
##########################################################################
#
start_info ()
#
{
echo "Startup/Shutdown Information
" >> $outfile
echo "RC Files
" >> $outfile
if [ $rev -ge 10 ]; then
what /sbin/rc >> $outfile
echo >> $outfile
echo "Contents of: /sbin/init.d"
echo >> $outfile
ls -C /sbin/init.d >> $outfile
echo >> $outfile
for dir in `ls -d /sbin/rc*.d/`
do
echo "Contents of: $dir" >> $outfile
echo >> $outfile
ls -C $dir >> $outfile
echo >> $outfile
done
else
pr -t -o5 /etc/rc >> $outfile
fi
}
#
##########################################################################
# Gets disk drive information for Series 800 systems.
##########################################################################
#
diskinfo8 ()
#
{
for devname in `ls /dev/rdsk`; do
if [ -c /dev/rdsk/$devname ]; then
/etc/diskinfo /dev/rdsk/$devname 1>>${outfile} 2>/dev/null
echo >> $outfile
else
echo "No information available for: "$devname >> $outfile
echo >> $outfile
fi
echo
done
}
#
##########################################################################
# Get disk information.
##########################################################################
#
get_disk ()
#
{
if [ $rev -ge 9 ]; then
echo "Bootable Logical Volumes:" >> $outfile
echo >> $outfile
lvlnboot -v 2>&1 >> $outfile
echo "Volume Group Display:" >> $outfile
echo >> $outfile
vgdisplay -v 1>> ${outfile} 2>/dev/null >> $outfile
echo "Logical Volume Display:" >> $outfile
echo >> $outfile
( for lvname in `/etc/vgdisplay -v 2>/dev/null| grep "LV Name" | awk '{ print $3 }'`;do
/etc/lvdisplay -v $lvname |sed '/Logical extents/,$d'
done
echo "
Physical Volume Display:" >> $outfile
echo >> $outfile
for pvname in `/etc/vgdisplay -v 2>/dev/null | grep "PV Name" | awk '{ print $3 }'`;do
/etc/pvdisplay -v $pvname > $tmpfile
cat $tmpfile | sed '/Physical extents/,$d'
echo "Logical Volume PE Offset"
cat $tmpfile | sed '1,/PE Status/d' | sed '$d' | find_pe_offsets
echo
done
echo >> $outfile
echo "LVM Information
" >> $outfile
) | pr -t -o5 1>> $outfile 2>/dev/null
fi
}
#
##########################################################################
# Display device file information
##########################################################################
#
device_files ()
#
{
echo "Device Files
" >> $outfile
if [ $type = 8 ] || [ $rev -ge 10 ]; then
if [ $rev -lt 8 ]; then
rm $tmpfile 2> /dev/null
for name in `find /dev ( -type c -o -type b ) -print `; do
/etc/lssf $name >> $tmpfile 2> /dev/null
done
echo "All Devices
" >> $outfile
sort $tmpfile | pr -t -o5 >> $outfile
else
/etc/ioscan -fn | pr -t -o5 >> $outfile
fi
fi
}
#
##########################################################################
# Gets network information.
##########################################################################
#
netinfo ()
#
{
echo "Network Information
" >> $outfile
echo "Host c" >> $outfile
nslookup `hostname` | sed -n '/Aliases/,/$/p' >> $outfile
echo >> $outfile
echo "Automount Status
" >> $outfile
grep -q AUTOMOUNT=1 /etc/rc.config.d/nfsconf
if [[ $? = 0 ]]; then
echo " Automount is enabled
" >> $outfile
echo " `grep AUTO_MASTER= /etc/rc.config.d/nfsconf`
" >> $outfile
else
echo " Automount is not enabled
" >> $outfile
echo >> $outfile
fi
echo "DNS Status
" >> $outfile
if [[ -f /etc/named.boot ]]; then
echo " DNS boot file found, listing named directory...
" >> $outfile
name_dir=`cat /etc/named.boot | grep directory | awk '{print $2}'`
ls $name_dir >> $outfile
echo >> $outfile
else
echo " DNS boot file not found
" >> $outfile
fi
echo "NIS Status
" >> $outfile
/usr/bin/ypwhich > /dev/null 2>&1
if [[ $? = 0 ]]; then
/usr/bin/ypwhich | pr -t -o5 >> $1
else
echo " NIS is not configured" >> $outfile
echo >> $outfile
fi
if [[ $? = 0 ]]; then
echo " This system uses super pages and may be suceptable to
a panic, check for the current current version of the following patches;
PHKL_14686
PHCO_12923
PHCO_14628
PHNE_14271
PHKL_12340
" >> $outfile
else
echo "This system does not use super pages." >> $outfile
fi
fi
}
#
##########################################################################
# Calculates total disk space.
##########################################################################
#
disk_total ()
#
{
VERHPUX=`uname -r | cut -d"." -f2`
if [[ $VERHPUX != 10 ]]; then
section="*s2"
else
section="*d0"
fi
typeset -i total size
size=0
total=0
echo "
The following disks were found...
"
for i in `ls /dev/rdsk/$section`
do
size=`diskinfo $i 2> /dev/null | grep size | awk '{print $2}'`
model=`diskinfo $i 2> /dev/null | grep product | awk '{print $3}'`
vendor=`diskinfo $i 2> /dev/null | grep vendor | awk '{print $2}'`
if [[ $vendor = TOSHIBA ]]; then
echo " $i is a $vendor CDROM, ignored.
"
else
total=`bc << EOF
$total+$size
EOF`
device=`echo $i | cut -d"/" -f4`
echo " The $vendor $model disk at $device is $size bytes in size."
fi
done
echo "
Total disk space reported is "$total" bytes.
"
}
#
##########################################################################
# Calculates allocated space utilization.
##########################################################################
#
space_alloc ()
#
{
typeset -i num used avail
num=0
for i in `bdf | awk '{print $2}' | grep -v kbytes`
do
num=$num+$i
done
echo "Total allocated disk space is $num Kbytes" >> $outfile
used=0
for i in `bdf | awk '{print $3}' | grep -v kbytes`
do
used=$used+$i
done
echo "Total disk space used from allocation is $used Kbytes" >> $outfile
avail=0
for i in `bdf | awk '{print $4}' | grep -v kbytes`
do
avail=$avail+$i
done
echo "Total disk space available from allocation is $avail Kbytes" >> $outfile
}
#
##########################################################################
# Finds Physical Extent offsets for each
# Logical volume on a Physical Volume.
##########################################################################
#
find_pe_offsets()
#
{
read pe status lv1 le
printf %-20.20s%9.4s\n $lv1 $pe
while read pe status lv le; do
if [ $status = "free" ]; then
lv=free
fi
if [ $lv != $lv1 ]; then
printf %-20.20s%9.4s\n $lv $pe
lv1=$lv
fi
done
}
#
##########################################################################
# Banner.
##########################################################################
#
make_banner()
#
{
echo \n\n
echo " "$1 $2 \n\n
banner $1 " $2"| pr -o5 -t
}
#
##########################################################################
# Ender.
##########################################################################
#
make_end()
#
{
echo \n\n
echo " ==============================End $1 $2=============================="
echo \n\n
}
#
###################################################################
# START THE SCRIPT
###################################################################
if [[ $# = 0 || $1 != '-'[a-z] ]]; then
echo "
Usage: collect -o [tape|lp|mail|file] -q -s"
echo " -o Specify output"
echo " -q Quiet mode"
echo " -s Summary mode
"
echo "Example:c"
echo " collect -s -o lp laserjet"
echo " send summary mode output to print queue "laserjet"
"
exit 1
fi
while getopts :o:qs options
do
case $options in
o) output=$OPTARG
;;
## i) menu=yes;;
q) mode=quiet;;
s) mode=summary;;
:) print "aaa
The -o option requires an argument!
" >&2
print " Please enter tape | lp | mail | file
" >&2
exit 1;;
?) print "aaa
$OPTARG is not a valid option!
" >&2
echo "Usage: collect -o [tape|lp|mail|file] -q
"
exit 1;;
esac
done
###################################################################
# Setup some paths and variables
###################################################################
type=`/bin/uname -m | /usr/bin/cut -c6`
if [ $type = 3 ]; then
type=4
fi
if [[ $outfile = "" ]]; then
outfile=/tmp/`hostname`.collect
fi
###################################################################
# Verifies "root" user, mode and sets traps.
###################################################################
if [ `whoami` != 'root' ]; then
echo "You must be root to run this script!"
exit 1
fi
if [[ $menu = yes ]]; then
report_menu
fi
if [[ $mode = 'quiet' ]]; then
outfile=/tmp/`hostname`.collect
fi
trap 'clean;exit 1' 1 2 15
###################################################################
# Parse the output option.
###################################################################
case $output in
tape)
default=/dev/rmt/0m
if [[ $# = 3 && $output = 'tape' ]] ; then
dev=$3
echo "
Validating tape: $dev ... c"
mt -t $dev rew >/dev/null 2>/dev/null
if [ $? -eq 0 ] ; then
echo OK.
destination=$dev
else
echo "
Invalid device specified, resetting to $default..."
echo "
Continue? Yes|No [yes] ==> c"
read ans
if [[ $ans = [Yy]* || -z $ans ]]; then
destination=$default
else
exit 1
fi
fi
else
echo "
No device specified, resetting to $default..."
echo "
Enter tape device ==> c"
read dev
if [[ -n $dev ]]; then
echo "
Validating tape: $dev ... c"
mt -t $dev rew >/dev/null 2>/dev/null
if [ $? -eq 0 ] ; then
echo OK.
destination=$dev
else
echo "
Invalid device specified, resetting to $default..."
echo "
Continue? Yes|No [yes] ==> c"
read ans
if [[ $ans = [Yy]* || -z $ans ]]; then
destination=$default
else
exit 1
fi
fi
fi
fi
;;
lp)
if [[ -n $LPDEST ]]; then
default=$LPDEST
else
default=`cat /usr/spool/lp/default`
## destination=$default
fi
if [[ $# < 3 && $output = 'lp' ]] ; then
echo "
Input printer queue ==> c"
read queue
if [[ -n $queue && -a /usr/spool/lp/interface/$queue ]]; then
echo OK.
echo "Queue set to $destination"
destination=$queue
else
echo "
Invalid printer specified, resetting queue to default..."
echo "
Queue set to $default"
echo "
Continue? Yes|No [yes] ==> c"
read ans
if [[ $ans = [Yy]* || -z $ans ]]; then
destination=$default
else
exit 1
fi
fi
elif [[ $# = 3 && $output = 'lp' ]]; then
if [[ -a /usr/spool/lp/interface/$3 ]]; then
destination=$3
else
echo "Invalid printer specified, resetting queue..."
echo "Queue set to $default"
echo "
Continue? Yes|No [yes] ==> c"
read ans
if [[ $ans = [Yy]* || -z $ans ]]; then
destination=$default
else
exit 1
fi
fi
fi
;;
mail)
if [[ $# = 3 && $output = 'mail' ]]; then
echo "Validating mail destination: $3 ... c"
/usr/lib/sendmail -bv $3 > /dev/null
if [ $? -eq 0 ]; then
echo OK.
destination=$3
else
echo "
The default destination is root
"
echo " Input a new recipient ==> c"
read destination
if [[ -n $destination ]]; then
echo "Validating mail destination: $destination ... c"
/usr/lib/sendmail -bv $destination > /dev/null
if [ $? -eq 0 ]; then
echo OK.
else
echo "
Invalid recipient specified"
echo "
Continue with default? Yes|No [yes] ==> c"
read ans
if [[ $ans = [Yy]* || -z $ans ]]; then
destination=root
else
exit 1
fi
fi
fi
fi
elif [[ $# < 3 ]]; then
echo "
The default destination root
"
echo " Input a new recipient ==> c"
read destination
if [[ -n $destination ]]; then
echo "Validating mail destination: $destination ... c"
/usr/lib/sendmail -bv $destination > /dev/null
if [ $? -eq 0 ]; then
echo OK.
else
echo "
No recipient specified"
echo "
Invalid recipient... reset to root."
echo "
Continue? Yes|No [yes] ==> c"
read ans
if [[ $ans = [Yy]* || -z $ans ]]; then
destination=root
else
exit 1
fi
fi
fi
fi
;;
file)
if [[ $# < 3 && $output = 'file' ]]; then
echo "
The default destination is /tmp/`hostname`.collect
"
echo " Input a new file name ==> c"
read destination
if [[ -n $destination ]]; then
outfile=$destination
else
echo "
No output file specified"
echo "
Continue? Yes|No [yes] ==> c"
read ans
if [[ $ans = [Yy]* || -z $ans ]]; then
outfile=/tmp/`hostname`.collect
else
exit 1
fi
fi
else
if [[ $# = 3 && $output = 'file' ]]; then
outfile=$3
else
echo "
The default destination is /tmp/`hostname`.collect
"
echo "
No output file specified"
echo "
Continue? Yes|No [yes] ==> c"
read ans
if [[ $ans = [Yy]* || -z $ans ]]; then
outfile=/tmp/`hostname`.collect
else
exit 1
fi
ls -l /usr/lib/year2000.o > /dev/null 2>&1
if [[ $? = 0 ]]; then
echo "
This system has a Y2K lib.c patch applied
" >> $outfile
else
echo "
This system does NOT have a Y2k lib.c patch applied
" >> $outfile
fi
if [[ $mode = summary ]]; then
echo "Collecting disk information..."
echo "BDF
" >> $outfile
bdf | pr -t -o5 >> $outfile
echo >> $outfile
echo "Cleaning up temporary files...c"
if [[ -f $tmpfile ]]; then
rm $tmpfile 2> /dev/null
fi
if [[ -f $tmpfile1 ]]; then
rm $tmpfile1 2> /dev/null
fi
echo "...Done."
echo "
The output file is $outfile"
exit 0
fi
##########################################################################
# Get general kernel information
##########################################################################
echo "Reading system configuration..."
kernel_info >> $outfile
swap_info >> $outfile
make_end Kernel Info >> $outfile
##########################################################################
# Display IO information
##########################################################################
##########################################################################
# Get files
##########################################################################
##########################################################################
# Disk and file system information
##########################################################################
echo "Collecting disk information..."
echo "Disk Information
" >> $outfile
echo "BDF
" >> $outfile
bdf | pr -t -o5 >> $outfile
echo >> $outfile
if [ -f /etc/mirrorrc ] ; then
echo "Mirror Status
" >> $outfile
mirror -l | pr -t -o5 >> $outfile
fi
disk_total >> $outfile
## diskinfo8 >> $outfile
get_disk >> $outfile
make_end Disk Info >> $outfile
##########################################################################
# Get Network information
##########################################################################
if [ $rev -ge 8 ]; then
echo "Getting Network information..."
netinfo $outfile
fi
make_end Network Info >> $outfile
##########################################################################
# List exported file systems
##########################################################################
if [ -f /etc/exports ]; then
echo "Exported File Systems
" >> $outfile
pr -t -o5 /etc/exports >> $outfile
echo >> $outfile
fi
##########################################################################
# Get subsystem info
##########################################################################
##########################################################################
# OpenSpool Information
##########################################################################
if [ -x /usr/bin/npstat ]; then
echo "OpenSpool Status
" >> $outfile
/usr/bin/npstat -E | pr -t -o5 >> $outfile
fi
if [ -x /usr/bin/npcshow ]; then
echo "OpenSpool Configuration
" >> $outfile
/usr/bin/npcshow -E | pr -t -o5 >> $outfile
fi
##########################################################################
# Network printer information
##########################################################################
echo "LAN Based Printers
" >> $outfile
(
n=`grep -cs hpnp /etc/bootptab`
if [ $n -gt 0 ]; then
echo "The /etc/bootptab is configured to support $n LAN based printers."
echo \n
fi
grep -q hpnp /usr/spool/lp/interface/*
if [[ $? = 0 ]]; then
echo "The following LAN based printers are configured into lp:
" >> $outfile
cd /usr/spool/lp/interface
grep -ls hpnp * | pr -3 -a -d -o10 -t >> $outfile
else
echo " No LAN based printers configured
" >> $outfile
fi
echo >> $outfile
)
##########################################################################
# DTC information
##########################################################################
if [ -x /etc/dtclist ]; then
for dtc in `/etc/dtclist -c`; do
echo "DTC Configuration for: $dtc
" >> $outfile
/etc/dtclist -c $dtc | pr -t -o5 >> $outfile
done
fi
if [ -f /etc/newconfig/ddfa/dp ]; then
echo "DDFA/DP
" >> $outfile
pr -t /etc/newconfig/ddfa/dp >> $outfile
fi
##########################################################################
# Check for Glance
##########################################################################
echo "Performance Monitoring
" >> $outfile
if [[ $rev -ge 9 ]] && [[ -x /usr/perf/bin/glance ]] || [[ $rev -ge 10 ]] && [[ -x /opt/perf/bin/glance ]]; then
echo " Glance is installed.
" >> $outfile
else
echo " Glance is not installed.
" >> $outfile
fi
##########################################################################
# NCS broker information
##########################################################################
if [ -x /usr/sbin/ncs/lb_admin ]; then
echo "NCS Location Broker Information
" >> $outfile
/usr/sbin/ncs/lb_admin <> $outfile
lookup * * *
quit
EOF
echo >> $outfile
fi
##########################################################################
# Sendmail information
##########################################################################
if [[ $rev -ge 10 ]]; then
smfile=/etc/mail/sendmail.cf
smorig=/usr/newconfig/etc/mail/sendmail.cf
else
smfile=/usr/lib/sendmail.cf
smorig=/etc/newconfig/sendmail.cf
fi
echo "Sendmail Configuration File Status
" >> $outfile
if [ -x /usr/lib/sendmail ]; then
if [ -f $smfile -a -f $smorig ]; then
diff -bwt $smfile $smorig >/dev/null 2>&1
(case $? in
0) echo "
The $smfile is the same as the original:
$smorig."
;;
1) echo "Sendmail.cf customizations:
" >> $outfile
diff -bwt $smfile $smorig
;;
*) echo "
There is a problem with the $smfile file."
;;
esac) | pr -t -o5 >> $outfile
fi
echo >> $outfile
##########################################################################
# ServiceGuard information
##########################################################################
if [ -f /etc/cmcluster/cmclconfig.ascii ]; then
echo "MC Service Guard Configuration
" >> $outfile
pr -t -o5 /etc/cmcluster/cmclconfig.ascii >> $outfile
fi
if [[ $rev -ge 10 ]] && [[ -d /var/spool/cron/crontabs ]]; then
for cron_tab in `ls /var/spool/cron/crontabs`
do
echo "
Crontabs:
" >> $outfile
echo "Contents of "$cron_tab"'s crontab:
" >> $outfile
cat /var/spool/cron/crontabs/$cron_tab >> $outfile
done
else
for cron_tab in `ls /usr/spool/cron/crontabs`
do
echo "Contents of "$cron_tab"'s crontab:
" >> $outfile
cat /usr/spool/cron/crontabs/$cron_tab >> $outfile
done
fi
make_end Subsys Info >> $outfile
##########################################################################
# Clean up
##########################################################################
echo "Cleaning up temporary files...c"
if [[ -f $tmpfile ]]; then
rm $tmpfile 2> /dev/null
fi
if [[ -f $tmpfile1 ]]; then
rm $tmpfile1 2> /dev/null
fi
echo "...Done."
echo "
The output file is $outfile"
###################################################################
# Process the output options
###################################################################
case $output in
tape)
outname=`basename $outfile`
tar -cv$destination -C /tmp $outname
echo "The system documentation has been tar'ed to:" $destination
echo "
A copy of the documentation is in: $outfile
"
;;
lp)
lp -d$destination $outfile
echo "The system documentation has been spooled to:" $destination
echo "
A copy of the documentation is in: $outfile
"
;;
mail)
mailx -s "System Snapshot" $destination < $outfile
echo "The system documentation has been mailed to:" $destination
echo "
A copy of the documentation is in: $outfile
"
;;
file)
echo "
A copy of the documentation is in: $outfile
"
;;