SUMMARY:sysinfo

From: <ARIBAS_at_T-Systems.es>
Date: Fri Jun 06 2003 - 01:50:12 EDT
Upon demand, enclosed is the entire cfg2html script. This script is an
enhancement of sysinfo, and thus collects all the useful informationf from a
systems.

Enjoy.

Toni


#!/bin/ksh
#
# set -vx
# $Header: /home/cvsroot/cfg2html_sun/cfg2html_sun.sh,v 1.5 2003/02/03
14:51:48
ralproth Exp $
############################################################################
# $Log: cfg2html_sun.sh,v $
# Revision 1.5  2003/02/03 14:51:48  ralproth
# Fixed cvs keywords, added log and version
#
############################################################################


PATH=$PATH:/local/bin:/local/sbin:/usr/bin:/usr/sbin:/local/gnu/bin:/usr/ccs/
bin
:/local/X11/bin:/usr/openwin/bin:/usr/dt/bin:/usr/proc/bin:/usr/ucb:/local/mi
sc/
openv/netbackup/bin
#
##
## we implement the Options as they are implemented in the Linux Version of
cfg2html
## 03Feb2003 it233 FRU U.Frey
# use "no" to disable a collection
#
CFG_NETWORK="yes" # <-- Network security, collecting tcpd and ip filter
settings
CFG_SYSTEM="yes"
CFG_CRON="yes"
CFG_HARDWARE="yes"
CFG_SOFTWARE="yes"
CFG_FILESYS="yes"
CFG_LVM="yes"
CFG_KERNEL="yes"
CFG_ENHANCEMENTS="yes"
CFG_APPLICATIONS="yes"
GIF="yes"
if [ "$OUTDIR" = "" ] ; then
  OUTDIR="."
fi
#
#
#
usage() {
  echo "  Usage: `basename $0` [OPTION]"
  echo "  creates HTML and plain ASCII host documentation"
  echo
  echo "  -o  set directory to write or use the environment"
  echo "                variable OUTDIR=\"/path/to/dir\" (directory must"
  echo "                exist"
  echo "  -v  output version information and exit"
  echo "  -h  display this help and exit"
  echo
  echo "  use the following options to disable collections:"
  echo
  echo "  -s  disable: System"
  echo "  -c  disable: Cron"
  echo "  -S  disable: Software"
  echo "  -f  disable: Filesystem"
  echo "  -d  disable: Disks"
  echo "  -k  disable: Kernel"
  echo "  -F  disable: Files"
  echo "  -n  disable: Network"
  echo "  -a  disable: Applications"
  echo "  -H  disable: Hardware"
  echo "  -x  don't create background images"
  echo
}
#
# getopt
#
#
#NO_ARGS=0
#if [ $# -eq "$NO_ARGS" ]  # Script invoked with no command-line args?
#then
#  usage
#  exit 1          # Exit and explain usage, if no argument(s) given.
#fi

while getopts ":o:xshcSfdkFnaHvh" Option
do
  case $Option in
    o     ) OUTDIR=$OPTARG;;
    v     ) echo $VERSION;exit;;
    h     ) usage;exit;;
    x     ) GIF="no";;
    s     ) CFG_SYSTEM="no";;
    c     ) CFG_CRON="no";;
    S     ) CFG_SOFTWARE="no";;
    f     ) CFG_FILESYS="no";;
    d     ) CFG_DISKS="no";;
    k     ) CFG_KERNEL="no";;
    F     ) CFG_FILES="no";;
    n     ) CFG_NETWORK="no";;
    a     ) CFG_APPLICATIONS="no";;
    H     ) CFG_HARDWARE="no";;
    *     ) echo "Unimplemented option chosen.";exit 1;;   # DEFAULT
  esac
done

shift $(($OPTIND - 1))
# Decrements the argument pointer so it points to next argument.

#

#RCCS="@(#)Cfg2Html-SUN Version 1.1" # useful for what (1)
#VERSION=`echo $RCCS|cut -c5-`
VERSION="Cfg2Html/SUN Version "$(echo "$Revision: 1.5 $" | cut -f2 -d" ")
MYNAME=`whence $0`
CFG_HOME=`dirname $MYNAME`
##CFG_HOME="/usr/local/scripts"
PLUGINS=$CFG_HOME/plugins
HTML_OUTFILE=$OUTDIR/`uname -n`.html
HTML_OUTFILE_TEMP=/tmp/`uname -n`.html.$$
TEXT_OUTFILE=$OUTDIR/`uname -n`.txt
TEXT_OUTFILE_TEMP=/tmp/`uname -n`.txt.$$
ERROR_LOG=$OUTDIR/`uname -n`.err
touch $HTML_OUTFILE
echo "Starting up $VERSION\r"
[ -s "$ERROR_LOG" ] && rm -f $ERROR_LOG 2> /dev/null
DATE=`date "+%Y-%m-%d"` # ISO8601 compliant date string
DATEFULL=`date "+%Y-%m-%d %H:%M:%S"` # ISO8601 compliant date and time string
IPADRESSE=`cut -d"#" -f1 /etc/hosts | awk '{for (i=2; i<=NF; i++) if
("'$HOSTNAME'" == $i) {print $1; exit} }'`
ANTPROS=`psrinfo | awk 'END {print NR}'`
SPEED=`psrinfo -v | awk '/MHz/{print $(NF-1); exit }'`
CPU=`uname -p`
TYPE=`uname -i`
LC_TIME="" date +"%a %b %e %Y   %H:%M"
CURRDATE=`LC_TIME="" date +"%b %e %Y"`
#Let the cache expire since this script runes every night
EXPIRE_CACHE=`LC_TIME="" date "+%a, %d %b %Y "`"23:00 GMT"


line ( ) {
echo --=[ http://come.to/cfg2html
]=-----------------------------------------------
}

echo "\n"

#########################################################
#    Check that you are running the script as root user
#########################################################
if [ `id|cut -c5-11` != "0(root)" ]
then
        banner "Sorry"
        line
        echo "You must run this script as Root\n"
        exit 1
fi

######### Check if /plugin dir is there #############################
if [ ! -x $PLUGINS/get_sap.sh ]
then
 banner "Error"
 line
 echo "Installation Error, the plugin directory is missing or execute
bit is not set"
 echo "You MUST install cfg2html via  tar xvf"
 echo "Plugin-Dir = $PLUGINS"
 exit 1
fi

exec 2> $ERROR_LOG

if [ ! -f $HTML_OUTFILE ]  ;
then
        banner "Error"
        line
        echo "You have not the rights to create $HTML_OUTFILE! (NFS?)\n"
        exit 1
fi

RECHNER=`uname -n`
VERSION_=`uname -r`
typeset -i HEADL=0                       #Headinglevel

osrev=`uname -r`

if [ "$osrev" -lt 2 ]
then
        banner "Sorry"
        line
        echo "$0: Requires Solaris 2.6 or better!\n"
        exit 1
fi
####################################################################
# needs improvement!
# trap "echo Signal: Aborting!; rm $HTML_OUTFILE_TEMP"  2 13 15
####################################################################
#  Beginn des HTML Dokumentes mit Ueberschrift und Titel
####################################################################
#  Header of HTML file
####################################################################

open_html() {
echo " \
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML> <HEAD>
 <META NAME="GENERATOR" CONTENT="Selfmade-$RCCS-vi Solaris 2.x">
 <META NAME="AUTHOR" CONTENT="t505414@online.no">
 <META NAME="CREATED" CONTENT="Trond Eirik Aune">
 <META NAME="CHANGED" CONTENT="`id` %A%">
 <META NAME="DESCRIPTION" CONTENT="$Header:
/home/cvsroot/cfg2html_sun/cfg2html_sun.sh,v 1.5 2003/02/03 14:51:48 ralproth
Exp $DATE root Exp $">
 <META NAME="subject" CONTENT="$VERSION on $RECHNER by t505414@online.no">
<TITLE>${RECHNER} - Documentation - $VERSION</TITLE>
</HEAD><BODY>
<BODY LINK="#0000ff" VLINK="#800080" BACKGROUND="cfg2html_back.jpg">
<H1><CENTER><FONT COLOR=blue>
<P><hr><B>$RECHNER - SunOS "`uname -r`" System Documentation</P></H1>
<hr><FONT COLOR=blue><small>Created "$DATEFULL" with " $VERSION
"</font></center></B></small>
<HR><H1>Contents\n</font></H1>\n\
" >$HTML_OUTFILE

(line;banner $RECHNER;line) > $TEXT_OUTFILE
echo "\n" >> $TEXT_OUTFILE
echo "\n" > $TEXT_OUTFILE_TEMP
}

######################################################################
#  Increases the headling level
######################################################################

inc_heading_level() {
HEADL=HEADL+1
##
## no we want to have it otherways
## it233 U.Frey
##echo "<UL>\n" >> $HTML_OUTFILE
echo "<UL type='square'>\n" >> $HTML_OUTFILE        # !!!!!
}

######################################################################
#  Decreases the heading level
######################################################################

dec_heading_level() {
HEADL=HEADL-1
echo "</UL>\n" >> $HTML_OUTFILE
}

######################################################################
#  Creates an own paragraph, $1 = heading
######################################################################

paragraph() {
if [ "$HEADL" -eq 1 ] ; then
    echo "\n<HR>\n" >> $HTML_OUTFILE_TEMP
fi
#echo "\n<table WIDTH="90%"><tr BGCOLOR="#CCCCCC"><td>\n">>$HTML_OUTFILE_TEMP
echo "<A NAME=\"$1\">" >> $HTML_OUTFILE_TEMP
echo "<A HREF=\"#Inhalt-$1\"><H${HEADL}> $1 </H${HEADL}></A><P>" >>
$HTML_OUTFILE_TEMP
#echo "<A HREF=\"#Inhalt-$1\"><H${HEADL}> $1 </H${HEADL}></A></table><P>" >>
$HTML_OUTFILE_TEMP

##
## no we do not want the gif at begin of line
## it233 30Jan2003 U.Frey
##echo "<IMG SRC="profbull.gif" WIDTH=14 HEIGHT=14>" >> $HTML_OUTFILE
echo "<A NAME=\"Inhalt-$1\"></A><A HREF=\"#$1\">$1</A>" >> $HTML_OUTFILE
echo "\nCollecting: " $1 " .\c"
echo "    $1" >> $TEXT_OUTFILE
}

######################################################################
#  Documents the single commands and their output
#  $1  = unix command,  $2 = text for the heading
######################################################################

exec_command() {

echo ".\c"

echo "\n---=[ $2
]=----------------------------------------------------------------" | cut
-c1-74 >> $TEXT_OUTFILE_TEMP
echo "       - $2" >> $TEXT_OUTFILE
######the working horse##########
TMP_EXEC_COMMAND_ERR=/tmp/exec_cmd.tmp.$$
EXECRES=`eval $1 2> $TMP_EXEC_COMMAND_ERR | expand | cut -c 1-150`
if [ -z "$EXECRES" ]
then
        EXECRES="n/a"
fi
if [ -s $TMP_EXEC_COMMAND_ERR ]
then
 echo "stderr output from \"$1\":" >> $ERROR_LOG
        cat $TMP_EXEC_COMMAND_ERR | sed 's/^/    /' >> $ERROR_LOG
fi
rm -f $TMP_EXEC_COMMAND_ERR

echo "\n" >> $HTML_OUTFILE_TEMP
echo "<A NAME=\"$2\"></A> <A HREF=\"#Inhalt-$2\"><H${HEADL}> $2
</H${HEADL}></A>\n" >>$HTML_OUTFILE_TEMP
echo "<PRE><B>$EXECRES</B></PRE>\n"  >>$HTML_OUTFILE_TEMP
echo "<meta http-equiv=\"expires\"
content=\"${EXPIRE_CACHE}\">">>$HTML_OUTFILE_TEMP
#echo "<PRE><SMALL><B>$EXECRES</B></SMALL></PRE>\n"  >>$HTML_OUTFILE_TEMP
echo "<LI><A NAME=\"Inhalt-$2\"></A><A HREF=\"#$2\">$2</A>\n" >>
$HTML_OUTFILE
echo "\n$EXECRES\n" >> $TEXT_OUTFILE_TEMP
}



################# Schedule a job for killing commands which ###############
################# may hang under special conditions. <mortene@sim.no> #####
# Argument 1: regular expression to search processlist for. Be careful
# when specifiying this so you don't kill any more processes than
# those you are looking for!
# Argument 2: number of minutes to wait for process to complete.

KillOnHang() {
        TMP_KILL_OUTPUT=/tmp/kill_hang.tmp.$$
        at now + $2 minutes 1>$TMP_KILL_OUTPUT 2>&1 <<EOF
ps -ef | grep root | grep -v grep | egrep $1 | awk '{print \$2}' | sort -n -r
|
xargs kill
EOF
        AT_JOB_NR=`egrep '^job' $TMP_KILL_OUTPUT | awk '{print \$2}'`
        rm -f $TMP_KILL_OUTPUT
}

# You should always match a KillOnHang() call with a matching call
# to this function immediately after the command which could hang
# has properly finished.
CancelKillOnHang() {
        at -r $AT_JOB_NR
}

################# adds a text to the output files, rar, 25.04.99 ##########

AddText() {

        echo "<p>$*</p>" >> $HTML_OUTFILE_TEMP
        echo "$*\n" >> $TEXT_OUTFILE_TEMP
}
######################################################################
#  end of the html document
######################################################################

close_html() {

echo "<hr>" >> $HTML_OUTFILE
echo "</P><P>\n<hr><FONT COLOR=blue>Created "$DATEFULL" with " $VERSION " by
<A
HREF="mailto:t505414@online.no?subject=$VERSION_">Trond E. Aune,
SysAdm</A></P></font>" >> $HTML_OUTFILE_TEMP
echo "</P><P>\n<FONT COLOR=blue>Based on the origional script by <A
HREF="mailto:Ralph_Roth@hp.com?subject=$VERSION_">Ralph Roth</A></P></font>"
>>
$HTML_OUTFILE_TEMP
echo "<hr><center>\
<A HREF="http://come.to/cfg2html">  [ Download cfg2html from external home
page
] </b></A></center></P><hr></BODY></HTML>\n" >> $HTML_OUTFILE_TEMP
cat $HTML_OUTFILE_TEMP >>$HTML_OUTFILE
cat $TEXT_OUTFILE_TEMP >> $TEXT_OUTFILE
rm $HTML_OUTFILE_TEMP $TEXT_OUTFILE_TEMP
echo "\n\nCreated "$DATEFULL" with " $VERSION " (c) 1998-2000 by Trond Eirik
Aune, SysAdm \n" >> $TEXT_OUTFILE
}

######################################################################
######################################################################
# Hauptprogramm mit Aufruf der obigen Funktionen und deren Parametern
######################################################################
#######################  M A I N  ####################################
######################################################################
line
##
##
## Bug corrected on display output files, no $PWD
## must be used here
## 30Jan2003 it233 U.Frey
echo "Starting          "$VERSION" on a "`uname -rsi`" box"
echo "Path to Cfg2Html  "$0
echo "Path to plugins "$PLUGINS
echo "HTML Output File  "$HTML_OUTFILE
echo "Text Output File  "$TEXT_OUTFILE
echo "Errors logged to  "$ERROR_LOG
echo "Started at        "$DATEFULL
echo "Problem           If cfg2html hangs on Hardware, press twice ENTER"
echo "                  or Crtl-D. Then check or update your Diagnostics!"
echo "WARNING           USE AT YOUR OWN RISK!!! :-))"
#echo "License      Freeware"
line

logger "Start of $VERSION"
open_html
inc_heading_level

######################################################################
if [ "$CFG_SYSTEM" != "no" ]
then # else skip to next paragraph

paragraph "Solaris/System"
inc_heading_level

exec_command "hostname" "Hostname"
exec_command "uname -n" "Host alias"
exec_command "uname -sr" "OS version"
exec_command "uname -mi" "Hardware type"
exec_command "prtconf | awk '/^Memory size:/ { print $3 }'" "Memory size"
exec_command "echo 'CPU's:' $ANTPROS of type $TYPE $CPU $SPEED MHz" "CPU's"
exec_command "uptime;sar 1 9" "Uptime, Load & SAR"
exec_command "sar -b 1 9" "Buffer Activity"


dec_heading_level

fi # terminates CFG_SYSTEM wrapper

###########################################################################
# Kernel Information
###########################################################################
if [ "$CFG_KERNEL" != "no" ]
then # else skip to next paragraph

paragraph "Kernel"
inc_heading_level
exec_command "modinfo" "Loaded kernel modules"
exec_command "sysdef -D" "System peripheral device driver"
##
## we want also display the /etc/system file
## it is important
## 30Jan2003 it233 U.Frey
if [ -e "/etc/system" ] ; then
  exec_command "cat /etc/system" "Parameter in /etc/system"
  exec_command "ls -l /etc/system*" "Boot Types of /etc/system"
fi

#for i in `sysdef -d |cut -f2 -d"'"`
#do
#echo "System pheriphial: $i"
#sysdef $i
#exec_command "sysdef $i  2>&1" "System  peripheral $i"
#done

dec_heading_level

fi # terminates CFG_KERNEL wrapper

######################################################################
# Harware Information
###########################################################################
if [ "$CFG_HARDWARE" != "no" ]
then # else skip to next paragraph

paragraph "Hardware"
inc_heading_level
exec_command "/usr/platform/sun4u/sbin/prtdiag -v" "Hardware (prtdiag)"
exec_command "prtconf -v" "Hardware (prtconf)"
#exec_command "sysinfo -class Device" "Devices"
dec_heading_level

fi # terminates CFG_HARDWARE wrapper

######################################################################
# Filesystem Information
###########################################################################
if [ "$CFG_FILESYS" != "no" ]
then # else skip to next paragraph

paragraph "Filesystems, Dump- and Swapconfiguration"
inc_heading_level

##
## we want to display the boot types
## of vfstab too
## 30Jan2003 it233 U.Frey
if [ -e "/etc/vfstab" ] ; then
  exec_command "ls -l /etc/vfstab*" "Boot Types of /etc/vfstab"
fi

exec_command "df -k" "Filesystems and Usage"

if [ -f /etc/exports ] ; then
    exec_command "cat /etc/exports|grep -v '^#'" "NFS Filesystems"
fi
    exec_command "swap -l" "Swap"

exec_command "vmstat -s" "Kernel paging events"
dec_heading_level
fi # terminates CFG_FILESYS wrapper

###########################################################################
if [ "$CFG_DISKS" != "no" ]
then # else skip to next paragraph

paragraph "Disks"
inc_heading_level

disklist () {
format <<-EOF | grep "^ *[0-9][0-9]*\. " | awk '{ print $2 }'
EOF
}
verdisk () {
format -d $1 <<-EOF | sed '1,/format> /d' | sed 's/format> //g'
verify
inquiry
quit
EOF
}
for i in `disklist`
do
exec_command "verdisk $i 2>&1" "Disk $i"
done

dec_heading_level

##
if [ -e "/opt/EMCpower/bin/powermt" ] ; then

  paragraph "EMC"
  inc_heading_level

  EMCver=`pkginfo -l EMCpower | grep -i version:`
  exec_command "echo $EMCver" "EMCpower Version"

  ##
  ## if there are EMC Disks display them with inq
  ## 30Jan2003 it233 U.Frey
  if [ -e "/opt/emc/SInquiry/V4.1/bin/inq" ] ; then
    exec_command "/opt/emc/SInquiry/V4.1/bin/inq" "EMC Disks Inquire"
  fi
  ##
  ## if EMCpower is installed display the powermt output
  ## 30Jan2003 it233 U.Frey
  if [ -e "/opt/EMCpower/bin/powermt" ] ; then
    exec_command "/opt/EMCpower/bin/powermt display dev=all" "EMC Power
Display"
  fi

  dec_heading_level
fi

##
if [ -e "/usr/sbin/metadb" ] ; then

  paragraph "SDS"
  inc_heading_level

  ##
  ## if there are Solstice Disks Suite Devices
  ## we display the configuration also
  ## 30Jan2003 it233 U.Frey
  if [ -e "/usr/sbin/metadb" ] ; then
    exec_command "/usr/sbin/metadb -i" "Status SDS Metadb"
  fi
  ##
  ## if there are Solstice Disk Suite Devices
  ## we display the Device configuration
  ## 30jan2003 it233 U.Frey
  if [ -e "/usr/sbin/metastat" ] ; then
    exec_command "/usr/sbin/metastat -t" "Status SDS Devices"
  fi

  dec_heading_level
fi

fi #terminate CFG_DISK wrapper
###########################################################################
if [ "$CFG_NETWORK" != "no" ]
then # else skip to next paragraph

paragraph "Network Settings"
inc_heading_level

exec_command "ifconfig -a" "Ifconfig"
exec_command "netstat -an" "list of all sockets"
exec_command "netstat -in" "list of all IP addresses"
exec_command "netstat -rvn" "list of all routing table entries"
exec_command "cat /etc/resolv.conf" "Resolv.conf"
exec_command "ypwhich 2>&1" "Ypwhich"
exec_command "domainname" "domainname"
exec_command "nslookup `hostname`" "Nslookup hostname"

dec_heading_level
fi #terminate CFG_NETWORK wrapper

###########################################################################
if [ "$CFG_PRINTER" != "no" ]
then # else skip to next paragraph
paragraph "Printers"
inc_heading_level
exec_command "lpstat -s" "Configured printers"
exec_command "lpstat -d" "Default printer"
exec_command "lpstat -t" "Status printers"

dec_heading_level
fi #terminate CFG_PRINTER wrapper
##########################################################################
###########################################################################
if [ "$CFG_CRON" != "no" ]
then # else skip to next paragraph
paragraph "Cron and At"
inc_heading_level

exec_command $PLUGINS/crontab_collect.sh "Crontab and AT scheduler"

dec_heading_level
fi #terminate CFG_CRON wrapper
##########################################################################
###########################################################################
if [ "$CFG_PASSWD" != "no" ]
then # else skip to next paragraph
paragraph "Password and Group"
inc_heading_level

exec_command "cat /etc/passwd | sed
's&:.*:\([-0-9][0-9]*:[-0-9][0-9]*:\)&:x:\1&'" "/etc/passwd"
exec_command "pwck 2>&1" "Errors found in passwd"
exec_command "cat /etc/group" "/etc/group"
exec_command "grpck 2>&1" "Errors found in group"


dec_heading_level
fi #terminate CFG_PASSWD wrapper
######################################################################
#  patch statistics
######################################################################
if [ "$CFG_SOFTWARE" != "no" ]
then
paragraph "Software"
inc_heading_level

#list_pkg () {
#pkginfo -l | awk '/^ *PKGINST:/{print}
                  #/^ *NAME:/{print}
                  #/^ *CATEGORY:/{print}
                  #/^ *VERSION:/{print}
                  #/^$/{print}' |
#sed '/^ *PKGINST:/{s/^ *PKGINST: *//; s/$/;/;}
     #/^ *NAME:/{s/^ *NAME: *//; s/$/;/;}
     #/^ *CATEGORY:/{s/^ *CATEGORY: *//; s/,.*//; s/$/;/;}
     #/^ *VERSION:/{s/^ *VERSION: *//;}' |
#sed -n '/./{
        #h
        #:top
        #n
        #/./H
        #/./b top
        #g
        #s/\n//g
        #p
        #}' |
#sed 's/^\([^;]*\);\([^;]*\);\([^;]*\);\([^;]*\)$/\3;\1;\4; \2 ;/'
#}

#exec_command "list_pkg | sed 's/ ;$//' | tr ';' '\011' | expand
-t1,12,26,60"
"Filesets installed "

exec_command "pkginfo " "Filesets installed "
exec_command "showrev -p" "Patches installed "

dec_heading_level

fi # terminates CFG_SOFTWARE wrapper

######################################################################
#  files statistics
######################################################################
if [ "$CFG_FILES" != "no" ]
then # else skip to next paragraph

paragraph "Files"
inc_heading_level
exec_command "cat /etc/inittab" "inittab"
files()
{
        ls /etc/hosts
        ls /etc/rc2.d/*
        ls /etc/rc3.d/*
}
COUNT=1
for FILE in `files`
do
exec_command "cat ${FILE}" "echo ${FILE}"
COUNT=`expr $COUNT + 1`
done

dec_heading_level
fi #terminates CFG_FILES wrapper
##########################################################################
if [ "$CFG_APPLICATIONS" != "no" ]
 then # else skip to next paragraph

 paragraph "Applications And Subsystems"

### COMMON ###############################################################
if [ "$CFG_DISKSUITE" != "no" ]
then # else skip to next paragraph
 inc_heading_level
 paragraph "Disksuite"
 inc_heading_level
 if [ -f /usr/sbin/metastat ] ; then
                ##
                ## awk does not work in the comand below
                ## 30Jan2003 it233 U.Frey
  ##DSVER=`pkginfo -l SUNWmdu |grep -i version: | awk'{ print }'`
  DSVER=`pkginfo -l SUNWmdu |grep -i version:`
  exec_command "echo $DSVER" "Disksuite Version"
  for i in metadb metastat
  do
                        ##
                        ## wrong path to metastat
                        ## 30Jan2003 it233 U.Frey
   exec_command "/usr/sbin/$i" "$i"
  done
 fi
 dec_heading_level
fi #terminate $CFG_DISKSUITE wrapper

##
## we want to display HP OpenVantage Operations configurations
## 31Jan2003 it233 FRU U.Frey
if [ -e /opt/OV/bin/OpC/utils/opcdcode ] ; then

  paragraph "HP OpenView"
  inc_heading_level
  if [ -e /opt/OV/bin/OpC/install/opcinfo ] ; then
    exec_command "cat /opt/OV/bin/OpC/install/opcinfo" "HP OpenView Info,
Version"
  fi
  if [ -e /var/opt/OV/conf/OpC/monitor ] ; then
    exec_command "/opt/OV/bin/OpC/utils/opcdcode /var/opt/OV/conf/OpC/monitor
|
grep DESCRIPTION" "HP OpenView Configuration MONITOR"
  fi

  if [ -e /var/opt/OV/conf/OpC/le ] ; then
    exec_command "/opt/OV/bin/OpC/utils/opcdcode /var/opt/OV/conf/OpC/le |
grep
DESCRIPTION" "HP OpenView Configuration LOGGING"
  fi

  dec_heading_level
fi

## we want to display Veritas netbackup configurations
## 31Jan2003 it233 FRU U.Frey
if [ -e /usr/openv/netbackup/bp.conf ] ; then

  paragraph "Veritas Netbackup"
  inc_heading_level
  if [ -e /usr/openv/netbackup/version ] ; then
    exec_command "cat /usr/openv/netbackup/version" "Veritas Netbackup
Version"
  fi
  exec_command "cat /usr/openv/netbackup/bp.conf" "Veritas Netbackup
Configuration"

  dec_heading_level
fi

### VxVM ###################################################################
#if [ -x /usr/sbin/vxdg ] ; then
 dec_heading_level
 paragraph "Veritas Volume Manager (VxVM `vmsa -V`)"
 inc_heading_level

 exec_command "vmsa_server -V; vmsa_server -q" "VxVM Version"
 exec_command "vxdisk list" "VxVM Disk Overview"
 exec_command $PLUGINS/VxVM_collect.sh "VxVM Collector"
#fi
### VXVA ###################################################################
if [ "$CFG_VXVA" != "no" ]
then # else skip to next paragraph
    paragraph "VXVA"
    inc_heading_level
if [ -f /opt/SUNWvxva/bin/vxva ]; then
for i in `vxdg list |awk '{print ($1)}'|grep -v NAME`
 do
 exec_command "echo $i" "volume group"
 exec_command "vxdg list $i" "Content of $i"
 done
exec_command "vxprint" "Vxprint"
exec_command "vxdg free" "vxdg free"
fi

dec_heading_level
fi # terminates CFG_VXVA wrapper

###########################################################################
if [ "$CFG_VXVM" != "no" ]
then # else skip to next paragraph
    paragraph "VxVM"
    inc_heading_level
if [ -f /usr/sbin/vxdg ]; then
 VXVMVER=`pkginfo -l VRTSvxvm |grep -i version: | awk '{ print $2 }'`
 exec_command "echo $VXVMVER" "VxVM version"
 exec_command "vxdisk list" "vxdisk list"
 for i in `vxdg list |awk '{print ($1)}'|grep -v NAME`
 do
 exec_command "vxdg list $i" "$i"
 done
 exec_command "vxprint" "Vxprint"
 exec_command "vxdg free" "vxdg free"
 exec_command "vxlicense -p" "vxlicense -p"
 for i in `ls /etc/vx/elm/*`
 do
  exec_command "cat $i" "content of $i"
 done
fi

dec_heading_level
fi # terminates CFG_VXVM wrapper

###########################################################################
if [ "$CFG_VXFS" != "no" ]
then # else skip to next paragraph
 paragraph "VxFS"
 inc_heading_level
 pkginfo |grep VRTSvxfs > /dev/null
 if [ $? -eq 0 ] ; then
 VXFSVER=`pkginfo -l VRTSvxfs |grep -i version: | awk '{ print $2 }'`
 exec_command "echo $VXFSVER" "VxFS version"
 fi
 dec_heading_level
fi # terminates CFG_VXVM wrapper
### Oracle ####################################
#if [ -f /etc/oratab ] ; then
    dec_heading_level
    paragraph "Oracle"
    inc_heading_level
#
###
## grep -v -E does not work on Sun
## 30jan2003 it233 U.Frey
    exec_command "cat /etc/oratab | grep -v '^#|^$|N'" "Configured Oracle
Databases"
    ##
    ## we want each Sid displayed with title
    for  DB in `grep ':' /etc/oratab|grep -v '#'|grep -v 'N'`
       do
         Ora_Home=`echo $DB | awk -F: '{print $2}'`
         Sid=`echo $DB | awk -F: '{print $1}'`
         Init=${Ora_Home}/dbs/init${Sid}.ora
         exec_command "cat $Init" "Oracle Instance $Sid"
       done
    ##
    ## each Sid displayed without title
    ## 30Jan2003 it233 U.Frey
    ##exec_command $PLUGINS/oracle_collect.sh "Oracle Databases"
#fi
###########################################################################
if [ "$(grep 'informix' /etc/passwd)" != "" ] ; then
    dec_heading_level
    paragraph "Informix"
    inc_heading_level
    exec_command "su - informix -c \"onstat -l\"" "Configured Informix
Databases"
fi
###########################################################################

if [ "$CFG_SAP" = "yes" ]
then # else skip to next paragraph

if [ -d /usr/sap ] ; then
    dec_heading_level
    paragraph "SAP R3"
    inc_heading_level
    exec_command $PLUGINS/get_sap.sh "SAP R3 Configuration"

[ -f /etc/sapconf ] && exec_command "cat /etc/sapconf" "Local configured SAP
R3
Instances"
fi
fi # terminates CFG_SAP wrapper

dec_heading_level
dec_heading_level

fi # terminates CFG_APPLICATIONS wrapper

close_html
###########################################################################

logger "End of $VERSION"
echo "\n"
line

rm -f core > /dev/null

########## remove the error.log if it has size zero #######################
[ ! -s "$ERROR_LOG" ] && rm -f $ERROR_LOG 2> /dev/null

if [ "$1" != "-x" ]
then
  exit 0
fi
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
Received on Fri Jun 6 02:25:46 2003

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:43:12 EST