#!/sbin/sh # # @(#) $ Revision: A.01.08 $ $ Author: Robert Sakic $ $ Date: August 2001 $ # ############################################################################### # # N I C K E L # # Network related Information Collector, Keeper and Elaborator # ############################################################################### # # # DESCRIPTION: yet another script to collect data, will display the # collected data as html. # ############################################################################### # # Copyright 1996 - 2001 Robert Sakic, HP # ALL RIGHTS RESERVED. # # Permission granted to use this script so long as the copyright above # is maintained, and credit is given for any use of the script. # ############################################################################### # # !!!! Legal Stuff !!!!! # ############################################################################### # # Copyright (C) 1996,1997,1998,1999 Hewlett-Packard Company # # The enclosed software and documention includes copyrighted works of # Hewlett-Packard Co. For as long as you comply with the following # limitations, you are hereby authorized to (i) use, reproduce, and # modify the software and documentation, and to (ii) distribute the # software and documentation, including modifications, for # non-commercial purposes only. # # 1. The enclosed software and documentation is made available at no # charge in order to advance the general development of support of # networking products. # # 2. You may not delete any copyright notices contained in the # software or documentation. All hard copies, and copies in # source code or object code form, of the software or # documentation (including modifications) must contain at least # one of the copyright notices. # # 3. The enclosed software and documentation has not been subjected # to testing and quality control and is not a Hewlett-Packard Co. # product. At a future time, Hewlett-Packard Co. may or may not # offer a version of the software and documentation as a product. # # 4. THE SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS". # HEWLETT-PACKARD COMPANY DOES NOT WARRANT THAT THE USE, # REPRODUCTION, MODIFICATION OR DISTRIBUTION OF THE SOFTWARE OR # DOCUMENTATION WILL NOT INFRINGE A THIRD PARTY'S INTELLECTUAL # PROPERTY RIGHTS. HP DOES NOT WARRANT THAT THE SOFTWARE OR # DOCUMENTATION IS ERROR FREE. HP DISCLAIMS ALL WARRANTIES, # EXPRESS AND IMPLIED, WITH REGARD TO THE SOFTWARE AND THE # DOCUMENTATION. HP SPECIFICALLY DISCLAIMS ALL WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # 5. HEWLETT-PACKARD COMPANY WILL NOT IN ANY EVENT BE LIABLE FOR ANY # DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES # (INCLUDING LOST PROFITS) RELATED TO ANY USE, REPRODUCTION, # MODIFICATION, OR DISTRIBUTION OF THE SOFTWARE OR DOCUMENTATION. # ############################################################################### # Below are some options you might want to modify. # Colors used in the script, change them for your needs FCOL=RED # Font Color for emphasized Text FCOL2=BLUE # Heading Font Color FCOL3=GREEN # Secondary Heading Font Color BGCOL=WHITE # Page Background Color HCOL=D1D1D1 # Heading Background Color # Options for the vmstat command VM_INT=5 # vmstat Interval VM_COUNT=1 # vmstat Count # Options for the iostat command IO_INT=5 # iostat Interval IO_COUNT=1 # iostat Count # Options for the system activity reporter command SAR_t=5 # sar seconds SAR_n=1 # sar Intervals ############################################################################### # # No need for user changes below this line. # ############################################################################### BASE=`basename $0` HOST=`hostname` MYTTY=`who am i | awk '{print $2}'` OUT_DIR=/tmp/$BASE.$HOST PATH=/usr/sbin:/usr/bin:/usr/contrib/bin:$PATH ORB_SBIN=/opt/orbplus/sbin ORB_LBIN=/opt/orbplus/lbin OCMP_OUT=/tmp/$BASE.$HOST/OCMP/ OOB=/opt/OCMP/bin EOO=/etc/opt/OCMP SBIN=/sbin UBIN=/usr/bin USBIN=/usr/sbin OS=$(uname -r | awk -F. '{print $2}') OsRel=`uname -r | awk -F. '{print $2"."$3}'` function _usage { print $* print "\nUsage:\n$0 [ -m | -o | -n | -? ]\n\nOptions:\n\t-m \tEmail the archive to \n\t-o \tWhere to direct the output\n\t-n\t\t\tDon't create archive\n\t-?\t\t\tshow this Help Menu\n This Script will collect System relevant data and save it either in a archive or in a directory named nickel.hostname (e.g. nickel.$HOST). Unless you've redirected your output with the -o option, you'll find a file\ncalled index.html in the /tmp/nickel.$HOST directory, open it with your\nfavourite Web browser to see the output of the script.\n\nnickel revision: `what $0|awk '{print $3}'`" exit 1 } function _init { _not_running _need_root _need_os SHAR=YES EMAIL=NO while getopts :nm:o: opt do case $opt in n) SHAR=NO ;; m) EMAIL=YES EMAILADDR=$OPTARG ;; o) OUT_DIR=$OPTARG ;; :) _usage "The -m and -o options require an argument."; ;; ?) if [ $OPTARG != "?" ] ; then _usage "invalid option $OPTARG" else _usage fi ;; esac done if [[ $SHAR = "NO" && $EMAIL = "YES" ]]; then _usage "\tYou must generate an archive to use the -m option" "\n\tRemove the -n from the command line"; fi _common } function _not_running { RUNNING=$(ps -ef|grep "$0"|grep -v grep|grep -v $$|grep -v man) if [[ "$RUNNING" != "" ]] then PID=$(echo ${RUNNING} | awk {"print \$2;exit"}) echo "\nERROR: The tool is already running under pid: ${PID}\n" echo "You must wait until it completes.\n" exit 1 fi } function _need_root { if [[ `id -u` != "0" ]] then echo "\nERROR: Your User ID appears to be: `id -u` (Loginname: $LOGNAME)\n" echo "Sorry, but you must have root privileges to run this script.\n" exit 1 fi } function _need_os { if [[ $OS != "10" && $OS != "11" ]] then echo "\nERROR: This Script supports only HP-UX 10 or HP-UX 11" exit 1 fi } function _make_directory { clear if [[ -d $OUT_DIR ]]; then echo "###\n###\tRemoving results left over from a previous run in" echo "###\t\t$OUT_DIR" echo "###" rm -rf $OUT_DIR fi if [[ -f $BASE.$HOST.tar.gz ]]; then echo "###\n###\tRemoving an older tar.gz file" echo "###\t\t$OUT_DIR/../$BASE.$HOST.tar.gz" echo "###" rm -f $OUT_DIR/../$BASE.$HOST.tar.gz fi clear echo "nickel revision: `what $0|awk '{print $3}'` \n\n\tNote, the Output will go to the following Directory: $OUT_DIR \n\tPoint your favourite Web browser to that directory and" echo "\topen the file index.html to see the results." mkdir $OUT_DIR LOGFILE=$OUT_DIR/nickel.log } ### HTML functions start here ### function _heading { echo "

\n

$1 $2 $3 $4 $5\n

" } function _footer { echo "\n" } function _item { echo "
$1 $2 $3 $4 $5 $6" } function _title { echo "`basename $1` $2 $3 $4 $5 " _heading `basename $1` $2 $3 $4 $5 echo "\n

"
}

function _title2 {
        echo "`basename $1` $2 $3 $4 $5
        "
        _heading2 `basename $1` $2 $3 $4 $5
        echo "\n
"
}

##############################################################################
#
# START RG
# Start of functions added by Roger Goff, HP, 12/98 for providing
# additional information in the index.html file
#
##############################################################################
###
### _mhz:  report the machine MHz value
###
function _mhz {
	whence sar > /dev/null && (( ncpu = `sar -M 1 1 | wc -l` - 5 ))|| ncpu=0
	[[ "$ncpu" -gt 1 ]] && echo "$ncpu x \c"
	echo `echo itick_per_tick/D | adb -k /stand/vmunix /dev/kmem \
	| grep "000" | awk '{print $2/10000 " MHz" }' `
}

###
### WHICH_PARAM:  pick the appropriate kernel parameters to query
###
function WHICH_PARAM
{
  if [[ $OsRel = "10.01" ]]
  then
    KernelSoftPage="__maxphysmem"
    SoftPgUnits="bytes"
    KernelRam=mem_ptr
    MbConversion=1048576    # For converting Physical Mem to MB
  elif [[ $OsRel = "10.10" || $OsRel = "10.20" ]]
  then
    KernelSoftPage="__maxphyspages"
    SoftPgUnits="4K"
    KernelRam=mem_ptr
    MbConversion=1048576    # For converting Physical Mem to MB
  elif [[ $OsRel = 11.+([0-9]) ]]
  then
    KernelSoftPage="__maxphyspages"
    KernelRam="memory_installed_in_machine"
    SoftPgUnits="4K"
    MbConversion=256    # For converting Physical Mem to MB
  fi
}

###
###  GET_REAL_MEMORY:  Find out how much PHYSICAL memory
###                    is in the system (regardless of what the soft
###                    page parameter is)
###
function GET_REAL_MEMORY
{
  Kernel=/stand/vmunix
  PhysicalMemory=`print "$KernelRam/U" | adb -k $Kernel /dev/kmem | \
   grep $KernelRam | awk '{ if (NF == 2) { print $2 }}'`
  # For HP-UX 10.X, the amount of memory is reported in bytes.
  # For HP-UX 11.X, the amount of memory is reported in 4K pages.
  eval `print | \
   awk '{
             printf "PhysicalMemory=%d\n", Val / Conversion;
        }' Val=$PhysicalMemory, Conversion=$MbConversion `

  # Check to see if we got a non-null, numeric answer
  if [[ ! -z $PhysicalMemory ]] && [[ $PhysicalMemory = +([0-9]) ]]
  then
    if (( $PhysicalMemory ))
    then
       echo "\n\t$PhysicalMemory MB"
    fi
  fi
}

###
### GET_SOFT_PAGES:  Get soft page parameter
###
function GET_SOFT_PAGES
{
 Kernel=/stand/vmunix
 SoftPgs=`print ${KernelSoftPage}?D | adb $Kernel - | \
    grep $KernelSoftPage | awk '{ if (NF == 2) {print $2}}'`

  # Check to see if we got a non-null, numeric answer

 if [[ ! -z $SoftPgs ]] && [[ $SoftPgs = +([0-9]) ]]
 then
   if (( SoftPgs ))
   then
     if [[ $SoftPgUnits = 4K ]]
     then
       (( SoftPgs /= 256 ))
     else
       (( SoftPgs /= 1024 ))
     fi
    # Only print out soft pages if memory has been soft-paged down.
     echo "\tKernel has been soft paged down to $SoftPgs MB"
   fi
 fi

}

###
### _ram:  get system ram amount
###
function _ram
{
WHICH_PARAM
GET_REAL_MEMORY
GET_SOFT_PAGES
}

###
### OS_VERSION:  determine version of the operating system, and 
###              use this information to set a shell variable,
###              OsVersion, which can then be used to determine
###              the appropriate action to take.
###

function OS_VERSION {

   if [[ $OsRel = 10.+([0-9]) ]] 
   then
     OsVersion=10
     NUMBEROFBITS="32-bit"
   else
     OsVersion=11
     NUMBEROFBITS=`getconf KERNEL_BITS`-bit
   fi
}

###
### GET_CPU_INFO
###
function GET_CPU_INFO {
 # First get the CPU version (i.e., PA1.1, PA2.0, etc.)
   Version=$(print ${HWRevParameter}/X | adb -k $Kernel /dev/kmem \
    | sed -e "s/$HWRevParameter:    //" -e "/$HWRevParameter:$/d" \
    | awk '{print $2}')
   Revision=$(print ${RevParameter}/X  | adb -k $Kernel /dev/kmem \
    | sed -e "s/${RevParameter}:            //" -e "/${RevParameter}:$/d"\
    | awk '{print $2}')
}


###
### _cpuversion
###
function _cpuversion {

HWRevParameter=cpu_version
RevParameter=cpu_revision_number
Kernel=/stand/vmunix

GET_CPU_INFO

if [[ $Version = 214 ]]  # If the processor is a PA2.0,
then
  Version=PA-RISC2.0
else
  Version=$(grep 0x$Version /usr/include/sys/unistd.h | awk '{print $7}')
fi

echo "${Version}"
}


###
### _revision
###
function _cpurevision {

HWRevParameter=cpu_version
RevParameter=cpu_revision_number
Kernel=/stand/vmunix

GET_CPU_INFO

if [[ $Version = 214 ]]  # If the processor is a PA2.0,
then
  Major=${Revision%%0*}
  Minor=${Revision#*0}
  Revision=v${Major}.${Minor}
else
  Revision=shit${Revision#@([0-9]|[A-F])@([0-9]|[A-F])@([0-9]|[A-F])@([0-9]|[A-F])@([0-9]|[A-F])@([0-9]|[A-F])@([0-9]|[A-F])}
  if [[ Revision = 7 ]]
  then
    Revision=v2.2 
  elif [[ Revision = 8 ]]
  then
    Revision=v2.3
  elif [[ Revision = 9 ]]
  then
    Revision=v2.4
  elif [[ Revision = A ]]
  then
    Revision=v2.5
  elif [[ Revision = B ]]
  then
    Revision=v2.6
  else
    Revision="Unknown Rev."
  fi
fi

echo "${Revision}"
}

##############################################################################
#
# END RG
# End of functions added by Roger Goff 12/98 for providing additional
# information in the index.html file
#
##############################################################################

function _index_html {
        echo "System Information for $HOST
        \n
\n
System Information for $HOST
`date`
nickel `grep Revision: $0 | grep -v awk | awk '{print $5}'`

\n\n
OS:" "`uname -r`", "`echo $NUMBEROFBITS`" " HW:" "`model -D` RAM:" "`_ram`
Uptime: `uptime|awk '{print $3,$4,$5}'` hours CPU: " "`_mhz`", " `_cpuversion`", " `_cpurevision`

Environment  Filesystem/Disk Info  installed software  (logfiles) 

`_create_link $USBIN/setboot` `_create_link $UBIN/crontab -l` `_create_link $USBIN/dmesg` `_graphinfo` `_collect_file hosts /etc/hosts` `_create_link $UBIN/iostat -t $IO_INT $IO_COUNT` `_create_link $UBIN/ipcs -bcop` Java `_create_link3 $USBIN/kmadmin -k` `_create_link3 $USBIN/kmadmin -S` `_create_link4 $USBIN/kmadmin -s` `_create_link $UBIN/locale` `_collect_file mail.log /var/adm/syslog/mail.log` `_create_link $UBIN/nfsstat` `_create_link $UBIN/ps -ef` `_collect_file rc.log /etc/rc.log` `_collect_file rc.log.old /etc/rc.log.old` `_create_link $UBIN/sar -A $SAR_t $SAR_n` sendmail  `_collect_file shutdownlog /var/adm/shutdownlog` `_stand_system` `_create_link $USBIN/sysdef` `_collect_file syslog /var/adm/syslog/syslog.log` `_collect_file OLDsyslog.old /var/adm/syslog/OLDsyslog.log` `_create_link $UBIN/vmstat -dS $VM_INT $VM_COUNT` `_create_link $UBIN/what /stand/vmunix` `_heading Hardware / Diagnostic` `_create_link $USBIN/ioscan -fnk` `_tombstones` `_diskinfo` `_diag_proc` `_cstm $USBIN/cstm` `_heading Network` \nlanscan:
`lanscan`

Network Information

" } function _create_link { if [ -x $1 ]; then if [ -f $1 ]; then NAME=`basename $1` echo "$NAME $2  " _common_function $1 $2 $3 $4 $5 > $OUT_DIR/$NAME.html fi fi } function _create_link2 { if [ -x $1 ]; then if [[ -f $1 && "`$1`" != "" ]]; then NAME=`basename $1` echo "$NAME $2  " _common_function $1 $2 > $OUT_DIR/$NAME.html fi fi } function _create_link3 { if [ -x $1 ]; then if [ -f $1 ]; then NAME=`basename $1` echo "$NAME $2  " _common_function $1 $2 $3 $4 $5 > $OUT_DIR/$NAME$2.html fi fi } function _create_link4 { if [ -x $1 ]; then if [ -f $1 ]; then NAME=`basename $1` echo "$NAME $2  " _common_function $1 $2 $3 $4 $5 > $OUT_DIR/${NAME}_$2.html fi fi } function _common_function { if [ -f $1 ]; then _title $1 $2 $3 $4 $5 _item `basename $1` $2 $3 $4 $5 echo "\n" $1 $2 $3 $4 $5 _footer fi } function _copy_file { if [ -f $1 ] ; then cp $1 $OUT_DIR/$2 fi } function _cp_all_files { BASE_all=`basename $1` if [ $2 != "0" ]; then echo "$1" fi cp -R $1 $OUT_DIR } function _cat_file { if [ -f $1 ]; then echo "

`_item $1`\n

\n`cat $1`\n
\n" fi } function _common { echo "nickel StartUp" _make_directory echo "\n\tcollecting system information...\n" _index_html > $OUT_DIR/index.html _hfsinfo > $OUT_DIR/hfsinfo.html echo "\n\tverifying Filesystem/Disk Information...\n" _fsdisk > $OUT_DIR/fs-disk.html echo "\n\tchecking installed software...\n" _installed_software > $OUT_DIR/software.html _software_logfiles > $OUT_DIR/software_logfiles.html _sendmail > $OUT_DIR/sendmail.html echo "\n\tcollecting network information...\n" _laninfo > $OUT_DIR/network.html _environment > $OUT_DIR/environment.html echo "\n\tchecking java...\n" _java > $OUT_DIR/java.html echo "\n\tchecking for optional software...\n" # check if System OpenView infected, i.e. TMN, NNM, ITO if [ -f /opt/OV/bin/ov.envvars.sh ]; then . /opt/OV/bin/ov.envvars.sh _ovstatus > $OUT_DIR/ovstatus.html if [ -f $OV_CONF/local_p_addr ]; then echo "\t\t * OpenView TMN" export PATH=$PATH:/opt/OV/bin _tmnindex >> $OUT_DIR/index.html _tmn > $OUT_DIR/tmn.html _nnm > $OUT_DIR/nnm.html elif [ -f $OV_BIN/ovw ]; then export PATH=$PATH:/opt/OV/bin echo "\t\t * OpenView Network Node Manager" _nnmindex >> $OUT_DIR/index.html _nnm > $OUT_DIR/nnm.html fi if [ -f $OV_BIN/OpC/opc ]; then export PATH=$PATH:/opt/OV/bin echo "\t\t * OpenView ITO" _itoindex >> $OUT_DIR/index.html _ito > $OUT_DIR/ito.html fi if [ -f $OV_NODELOCK/nodelock ]; then _licensing > $OUT_DIR/ifor.html fi fi echo "\n\tchecking for OpenCall, OpenMail, OmniBack, MC/SG, ORB, ISDN, X25..." _openCall # OpenCall SS7, IN, MultiService? _openmail # OpenMailing? _omniback # OmniBack? _sg # Service Guard involved? _orbplus # any ORB around? _isdn # ISDN ready? _x25 # X.25 somewhere ? _sna # SNA ? _y2k # Year 2000 Check ! echo "`what $0` " >> $OUT_DIR/index.html if [ ${SHAR} = YES ]; then echo "\n\n" tar cvf ${BASE}.${HOST}.tar ${OUT_DIR} gzip -9 ${BASE}.${HOST}.tar #rm -rf $OUT_DIR echo "\n\tCreated archive file: $BASE.$HOST.tar.gz" if [ ${EMAIL} = YES ]; then uuencode ${BASE}.$HOST.tar.gz ${BASE}.$HOST.tar.gz|\ /usr/bin/mailx -s "nickel tool output for $HOST" $EMAILADDR fi fi } function _inetd { _title inetd echo "
inetd.conf inetd.sec

\n"
        _cat_file /etc/inetd.conf
        echo "\n
\n
" _cat_file /var/adm/inetd.sec _footer } function _netfmt { FILE=$OUT_DIR/netfmt.html echo "netfmt" if [ -f /var/adm/nettl.LOG000 ] ; then echo "`_title netfmt -f /var/adm/nettl.LOG000`" >> $FILE echo "`_item /usr/sbin/netfmt -f /var/adm/nettl.LOG000`">> $FILE echo "`/usr/sbin/netfmt -f /var/adm/nettl.LOG000`

" >> $FILE else echo "`_title netfmt -f /var/adm/nettl.LOG000`" >> $FILE echo " /var/adm/nettl.LOG000 not found." >> $FILE fi _footer >> $FILE } function _stand_system { FILE=stand_system.html echo "/stand/system  " echo "`_title /stand/system` `_cat_file /stand/system` `_footer`" > $OUT_DIR/$FILE } function _collect_file { if [ -f $2 ]; then FILE=$1.html echo "$1  " echo "`_title $2` `_cat_file $2` `_footer`" > $OUT_DIR/$FILE fi } function _cstm { if [ -f $1 ]; then if [ "`swlist -l product|grep \"^ PHSS_14407\"`" ]; then echo "PHSS_14407 installed!" else FILE1=cstm.html FILE2=cstm_cpu.html echo "Diagnostics   CPU Diagnostics  " echo "Map\nSelAll\nInformation ; wait InfoLog\nDone\nExit\nOK" >$OUT_DIR/cstm_i echo "`_title DIAGNOSTICS``$USBIN/cstm -f $OUT_DIR/cstm_i` `_footer`" > $OUT_DIR/$FILE1 echo "SelClass type \"Processor\" qualifier \"CPU\" hwpath \"\" Information ; wait\nInfoLog\nDone\nExit\nOK" >$OUT_DIR/cstm_c echo "`_title CPU DIAGNOSTICS` `$USBIN/cstm -f $OUT_DIR/cstm_c` `_footer`" > $OUT_DIR/$FILE2 rm $OUT_DIR/cstm_c $OUT_DIR/cstm_i fi fi } function _diskinfo { FILE=$OUT_DIR/diskinfo.html echo "Diskinfo  " echo "`_title Diskinfo``_item diskinfo -v`" > $FILE for i in `ls /dev/rdsk/c*` do diskinfo -v $i 2> $LOGFILE echo "\n" >> $FILE done >> $FILE echo "`_footer`" >> $FILE } function _tombstones { if [ -f /var/tombstones/ts99 ]; then FILE=$OUT_DIR/tombstones.html echo "tombstones  " echo "`_title tombstones`" >$FILE echo "`_cat_file /var/tombstones/ts99`\n`_footer`" >> $FILE fi } function _graphinfo { if [ -c /dev/crt ]; then FILE=$OUT_DIR/graphinfo.html echo "graphinfo  " echo "`_title graphinfo` Available Graphic devices:
" > $FILE # create links at top of page for i in `ls /dev/crt*` do echo "$i" >> $FILE done >> $FILE # execute graphinfo for each device file found echo "

\n

" >> $FILE for i in `ls /dev/crt*` do echo "`_item graphinfo $i`" graphinfo $i 2>> $FILE echo "\n" >> $FILE done >> $FILE echo "`_footer`" >> $FILE fi } function _diag_proc { FILE=diagproc.html echo "Diag SW/Proc's  " echo "`_title Diag related SW/Processes``_item SW`">$OUT_DIR/$FILE echo "`swlist -l product | grep -i -e upp -e red -e iag`\n\n \n`_item Processes`\n`ps -ef | grep -i -e mon -e log | grep -v rlog` `_footer`" >> $OUT_DIR/$FILE } function _services { _title /etc/services _cat_file /etc/services _footer } function _laninfo { _title Network Information echo "\t`_netstat`\t`_gated`\t`_name_resolution`\n `_cp_all_files /etc/rc.config.d 1`\t`_create_link /usr/sbin/arp -a`\t\t`_services>$OUT_DIR/services.html`/etc/services\n\t" _inetd > $OUT_DIR/inetd.html echo "\tinetd.sec/conf\t\t`_netfmt`
`_item lanscan`\n\n`lanscan`
`_item ioscan -fnC lan`\n`ioscan -fnC lan`
`_item ifconfig/ping/linkloop/nslookup for every LANIC`\n
\n" for LANIC in `lanscan -i|awk '{print $1}'|grep -v atm|grep -v cip|grep -v el10` do export MACADDR=`lanscan|grep $LANIC | awk '{print $2}'` if [[ $OS = "10" ]]; then export MACTYPE=`lanscan|grep $LANIC | awk '{print $8}'` export LINKLOOPIF=$LANIC else export MACTYPE=`lanscan|grep $LANIC | awk '{print $7}'` export LINKLOOPIF=`lanscan -ip|grep $LANIC | awk '{print $NF}'` fi export NMID=`lanscan|grep " $LANIC "| awk '{print $7}'` STATUS=0 if [ "`lanscan | awk '/'$LANIC'/ && !/awk/ {print $6}'`" != "DOWN" ]; then if [ `ifconfig $LANIC|awk '/inet/ && !/awk/ {print $2}'` ]; then STATUS=1 IPADDR=`ifconfig $LANIC|awk '/inet/ && !/awk/ {print $2}'` export IFNAME=`nslookup $IPADDR | awk '/Name:/ && !/awk/ {print $2}'` export IFSHORT=`echo $IFNAME|cut -d . -f1` fi fi echo "\n\n\n `_linkloop $NMID $MACADDR $LINKLOOPIF` `_lanadmin $NMID $LANIC` `_ping $IPADDR` `_nslookup $IPADDR` `_nslookup $IFSHORT`
$LANIC:
ifconfig:
`ifconfig $LANIC|sed 's//\>/`
\n

" done echo "" } function _linkloop { if [[ $MACTYPE != "X25" && $MACTYPE != "FDDI" ]]; then export INSTANCE=$3 if [[ $OS = "10" ]]; then export INSTANCE=$1 fi echo " linkloop:

`linkloop -i$INSTANCE $2`
" fi } function _gated { echo "gated information " echo "`_title gated`\n

`what /usr/sbin/gated`


`_cat_file /etc/gated.conf`" > $OUT_DIR/gated.html } function _lanadmin { if [[ $MACTYPE != "X25" ]]; then export INSTANCE=$2 if [[ $OS = "10" ]]; then export INSTANCE=$1 fi echo " lanadmin:

`lanadmin -m $INSTANCE`\n`lanadmin -s $INSTANCE`\n`lanadmin -x $INSTANCE 2> $LOGFILE`
" fi } function _ping { if [[ "$1" != "" && "$STATUS" -eq "1" ]]; then echo " ping:
`ping $1 -n 3`
" fi } function _nslookup { if [[ "$1" != "" && "$STATUS" -eq "1" ]]; then echo " nslookup
$1
`nslookup $1`
" fi } function _name_resolution { echo "name resolution information " _title Name Resolution >> $OUT_DIR/nameres.html if [ -f /etc/resolv.conf ] ; then echo "`_item resolv.conf`\n`cat /etc/resolv.conf`

" \ >> $OUT_DIR/nameres.html fi if [ -f /etc/nsswitch.conf ] ; then echo "


\n`_item nsswitch.conf`\n`cat /etc/nsswitch.conf`" \ >> $OUT_DIR/nameres.html else echo "`_item no nsswitch.conf`\n" >> $OUT_DIR/nameres.html fi echo "\n" >> $OUT_DIR/nameres.html } function _netstat { echo "netstat information" echo "\n`_title netstat`
"> $OUT_DIR/netstat.html if [ $OS != 11 ]; then echo "">> $OUT_DIR/netstat.html fi echo "
netstat -rnnetstat -mnetstat -s netstat -an

\n`_item netstat -rn`
`netstat -rn`

" >> $OUT_DIR/netstat.html if [ $OS != 11 ]; then echo "
`_item netstat -m`
`netstat -m` 

" >> $OUT_DIR/netstat.html fi echo "
`_item netstat -s`
`netstat -s` 

`_item netstat -an`
`netstat -an`

\n" >> $OUT_DIR/netstat.html } function _environment { _title Environment Variables env _footer } function _installed_software { if [ $OS -eq 11 ]; then SWSTRING="swlist -l fileset -a state -a patch_state" SWSTRHTML="
swlist -l fileset -a state -a patch_state" else SWSTRING="swlist -l fileset -a state" SWSTRHTML="swlist -l fileset -a state" fi _title Installed Software echo "Total Number of Patches installed: `swlist -l product|grep ' PH'|wc -l` $SWSTRHTML
swlist -l bundle swlist -l product swlist -l product | grep PH

\n"
        _item swlist -l bundle
        swlist -l bundle
        echo "
\n
" _item swlist -l product swlist -l product echo "
\n
" _item swlist -l product | grep PH swlist -l product | grep PH echo "
\n
" _item $SWSTRING $SWSTRING _footer } function _software_logfiles { _title SDUX Logfiles echo " /var/adm/sw/swagent.log
/var/adm/sw/swagentd.log
/var/adm/sw/swconfig.log
/var/adm/sw/swinstall.log
/var/adm/sw/swmodify.log
/var/adm/sw/swremove.log


\n"
	_cat_file /var/adm/sw/swagent.log
        echo "
\n
" _cat_file /var/adm/sw/swagentd.log echo "
\n
" _cat_file /var/adm/sw/swconfig.log echo "
\n
" _cat_file /var/adm/sw/swinstall.log echo "
\n
" _cat_file /var/adm/sw/swmodify.log echo "
\n
" _cat_file /var/adm/sw/swremove.log } function _fsdisk { _title Filesystem and Harddisk Information echo "\nLogical Volume Manager Information" _lvminfo > $OUT_DIR/lvminfo.html echo "\nMountable file-system entries: `_create_link /usr/bin/cat /etc/fstab` \nNumber of free disk blocks: `_create_link $UBIN/bdf` \nmounted file systems: `_create_link /etc/mount -p` \nClients that have remotely mounted a filesystem: `_create_link $USBIN/showmount -a 2> $LOGFILE` \nSystem paging space information: `_create_link /etc/swapinfo` \nDisplay current values contained in the primary super-block: tunefs -v  \n`_create_link $UBIN/strings /etc/lvmtab`

" _footer } function _lvminfo { _title LVM Information echo "General Information about LVM: `_create_link $USBIN/vgdisplay -v`, `_create_link $USBIN/lvlnboot -v`
  • Number of available Logical Volumes: `vgdisplay -v|awk '/LV Name/'|wc -l`
  • Names of available Logical Volumes:
    " mkdir -p $OUT_DIR/lvmdirectory/dev/dsk for r in `vgdisplay |awk '/VG Name/ && !/awk/ {print $3}'` do mkdir -p $OUT_DIR/lvmdirectory/$r done for i in `vgdisplay -v |awk '/LV Name/ && !/awk/ {print $3}'` do echo "$i " done for k in `vgdisplay -v |awk '/LV Name/ && !/awk/ {print $3}'` do echo "
\n`_title Processing Logical Volume $i` \nfstyp -v $k" > $OUT_DIR/lvmdirectory$k.html fstyp -v $k >> $OUT_DIR/lvmdirectory$k.html done echo "
  • Number of available Volume Groups: `vgdisplay|awk '/VG Name/'|wc -l`
  • Names of available Volume Groups:
    " for i in `vgdisplay |awk '/VG Name/ && !/awk/ {print $3}'` do echo "$i " done echo "
  • " for i in `vgdisplay |awk '/VG Name/ && !/awk/ {print $3}'` do echo "
    \n`_title Processing Volume Group $i` \nvgdisplay -v $i
    "> $OUT_DIR/lvmdirectory$i.html
    		vgdisplay -v $i		>> $OUT_DIR/lvmdirectory$i.html
    		echo "\n
    \n

    Processing Logical Volumes of Volume Group $i

    " >> $OUT_DIR/lvmdirectory$i.html for j in `vgdisplay -v $i |awk '/LV Name/ && !/awk/ {print $3}'` do echo "lvdisplay -v $j
    "
    			lvdisplay -v $j
    			done >> $OUT_DIR/lvmdirectory$i.html
    		done
    		echo "\n
      \n
    • Number of available Physical Volumes: `vgdisplay -v |awk '/PV Name/'|wc -l`
    • Names of available Physical Volumes:

      " for i in `vgdisplay -v|awk '/PV Name/ && !/awk/ {print $3}'` do echo "$i " done echo "
    " for k in `vgdisplay -v |awk '/PV Name/ && !/awk/ {print $3}'` do echo "
    \n`_title Processing Physical Volume $i` \npvdisplay -v $k" > $OUT_DIR/lvmdirectory$k.html pvdisplay -v $k >> $OUT_DIR/lvmdirectory$k.html done _footer } function _sendmail { _title SendMail Information mkdir $OUT_DIR/sendmail.conf echo "`what /usr/sbin/sendmail|grep -i version`\n\n
    \n" echo "

    Name Services " cp /etc/mail/* $OUT_DIR/sendmail.conf echo "Config files " _footer } function _hfsinfo { _title HFS File System Information /etc/mount -p|grep " hfs "|awk '{print $1}{system("tunefs -v " $1)}' _footer } function _orb_command { _item $1 $2 $1 $2 echo "\n" } function _orbadmin { _title orb_admin _orb_command $ORB_SBIN/orb_admin pr_inc _orb_command $ORB_SBIN/orb_admin pr_ir _orb_command $ORB_SBIN/orb_admin pr_trader _orb_command $ORB_SBIN/orb_admin list_iref _orb_command $ORB_SBIN/orb_admin list_iref _footer } function _orbplus { # ORB installed? (there must be a better way to determine # the existence of an installed ORB) if [ -f /opt/orbplus/lbin/obj_locator ]; then echo "`_heading ORB Plus`\n ORB Info " >> $OUT_DIR/index.html echo "`_title ORB Plus`\nConfiguration files\norbadmin`mkdir $OUT_DIR/orb.conf` `cp /etc/opt/orbplus/* $OUT_DIR/orb.conf` `_orbadmin > $OUT_DIR/orbadmin.html` `_orb_command $ORB_LBIN/naming_server ls_servers`

    \n `_footer`" > $OUT_DIR/orbplus.html echo "\t\t * ORB Plus" fi } function _isdn { if [ -f /opt/ISDN_SCSI/bin/isdninfo ]; then FILE=$OUT_DIR/isdn.html echo "\t\t * ISDN" _heading ISDN >> $OUT_DIR/index.html echo "more info  " >> $OUT_DIR/index.html _title ISDN > $FILE /opt/ISDN_SCSI/bin/isdninfo >> $FILE echo "
    \n" >> $FILE fi } function _openmail { if [ -f /opt/openmail/diag/omenquire ]; then FILE1=$OUT_DIR/om_basic.html FILE2=$OUT_DIR/om_unix.html echo "\t\t * OpenMail" _heading OpenMail >> $OUT_DIR/index.html echo "omenquire basic   omenquire unix  " >> $OUT_DIR/index.html _title OpenMail - omenquire basic > $FILE1 _title OpenMail - omenquire unix > $FILE2 mv /var/opt/openmail/tmp/enquire_out /var/opt/openmail/tmp/enquire.old /opt/openmail/diag/omenquire basic _cat_file /var/opt/openmail/tmp/enquire_out >> $FILE1 _footer >> $FILE1 rm /var/opt/openmail/tmp/enquire_out /opt/openmail/diag/omenquire unix _cat_file /var/opt/openmail/tmp/enquire_out >> $FILE2 _footer >> $FILE2 mv /var/opt/openmail/tmp/enquire.old /var/opt/openmail/tmp/enquire_out fi } function _openCall { echo "\n\tchecking for OpenCall software..." if [ -d /opt/OCMP/bin ]; then _ocmpindex >> $OUT_DIR/index.html echo "\n\tlisting installed OpenCall software..." _ocmpsoft > $OUT_DIR/ocmpsoft.html echo "\n\tcollecting OpenCall configuration..." mkdir $OUT_DIR/OCMP/ echo "`_cp_all_files /etc/opt/OCMP/ 1`" >> /dev/null echo "\n\tbeginning collection for OpenCall software..." _ocmpinfo > $OUT_DIR/ocmp.html echo "\n\tbeginning listing of OpenCall software..." _ocmplist > $OUT_DIR/ocmplist.html echo "\n\tgathering OpenCall logs and traces..." _ocmptrace > $OUT_DIR/ocmptrace.html echo "\n\tgathering OpenCall traces..." _ocmptrc > $OUT_DIR/ocmptrc.html echo "\n\tbeginning collection for OpenCall software configuration..." _ocmpcollectconf echo "\n\tParsing OpenCall xml configuration files..." _ocmpxml echo "\n\tfinished parsing OCMP xml..." echo "\n\tGathering running process information..." _ocmpproc > $OUT_DIR/ocmpproc.html echo "\n\tFormatting properties file..." _ocmpprop > $OUT_DIR/ocmpprop.html echo "\n\tfinished OpenCall software collection..." fi } function _omniback { if [ -f /etc/opt/omni/cell/cell_server ]; then FILE1=$OUT_DIR/omni_cell_info.html FILE2=$OUT_DIR/omni_db_info.html echo "\t\t * OmniBack" _heading OmniBack >> $OUT_DIR/index.html echo "Cell Server: `cat /etc/opt/omni/cell/cell_server`   " >> $OUT_DIR/index.html if [ -f /etc/opt/omni/cell/cell_info ]; then echo "Cell Info   " >> $OUT_DIR/index.html fi if [ -f /opt/omni/sbin/omnidbutil ]; then echo "DataBase Info " >> $OUT_DIR/index.html echo "  " >> $OUT_DIR/index.html echo "`_title Cell Info` `_cat_file /etc/opt/omni/cell/cell_info` `_footer`" > $FILE1 echo "`_title Database Information` \n`/opt/omni/sbin/omnidbutil -info` `_footer`" > $FILE2 fi fi } function _y2k { echo "\t\t * Year 2000 Check\n" MISSING_Y2K_PATCHES=TRUE FILE=$OUT_DIR/index.html echo "`_heading Year 2000`" >> $FILE if [ -f /usr/contrib/bin/y2k* ]; then MISSING_Y2K_PATCHES=FALSE if [ -f /usr/contrib/bin/y2koscheck ]; then echo "Operating System related Y2K Information: `_create_link /usr/contrib/bin/y2koscheck -v`\n
    " >> $FILE else MISSING_Y2K_PATCHES=TRUE echo "missing y2koscheck utility">> $FILE fi if [ -f /usr/contrib/bin/y2kappcheck ]; then echo "Application related Y2K Information: `_create_link /usr/contrib/bin/y2kappcheck`
    " >> $FILE else MISSING_Y2K_PATCHES=TRUE echo "missing y2appcheck utility">> $FILE fi fi if [ $MISSING_Y2K_PATCHES = "TRUE" ]; then echo "

    WARNING!

    y2koscheck and / or y2kappcheck utility not found!

    \n Please apply Patch PHCO_17806 (y2koscheck - HP-UX 10.X); PHCO_17807 (y2koscheck - HP-UX 11.X); PHCO_20220 (y2kappcheck - HP-UX 10.X); PHCO_20221 (y2kappcheck - HP-UX 11.X) or any subsequent Patch to enable this System for a Year 2000 Check.

    \nYou'll find this Patch (and others) @ the Americas and Asia-Pacific Electronic Support Center or the European Electronic Support Center\n" >> $FILE fi echo "\n


    \n" >> $FILE } function _x25 { if [ -f /usr/sbin/x25stat ]; then FILE=$OUT_DIR/x25.html echo "\t\t * X.25" _heading X.25 >> $OUT_DIR/index.html echo "x25stat " >> $OUT_DIR/index.html _title X.25 > $FILE for DEVICE_FILE in `ls /dev/x25_* /dev/zx25*` do _item $DEVICE_FILE /usr/sbin/x25stat -c -d $DEVICE_FILE echo "\n\n" done >> $FILE echo "\n" >> $FILE fi } ### Network Node Manager Stuff ### function _nnm { _title NNM Information echo "`_item NNM Version`\t`_nnmversion` `_item Objects in Database``$OV_BIN/ovobjprint -S| awk '/objects defined in the database/ && !/awk/ {print $1}'`

    Config files\tLocal Registration Files\tOV_LOG\tOV_PRIV_LOG \novstatus  Map's  topology \n`_cp_all_files $OV_LOG 0` `mv $OUT_DIR/log $OUT_DIR/ov.log` \n`_cp_all_files $OV_PRIV_LOG 0` `mv $OUT_DIR/log $OUT_DIR/ovpriv.log` `_item OV related Software installed:` \n`swlist -l product|grep OV|grep -v PHSS|sort`\n `_item OV related Patches installed:` \n`swlist -l product|grep OV|grep PHSS|sort`\n `_snmp` `_ovobjprint` \n" _ovtopo > $OUT_DIR/ovtopo.html _mapinfo > $OUT_DIR/ovmap.html _nnm_conf_files } function _ito { _title OpenView ITO Information echo "`_item OpenView ITO Version`\t`_itoversion` `_item Objects in Database``$OV_BIN/ovobjprint -S| awk '/objects defined in the database/ && !/awk/ {print $1}'`

    Config files\tLocal Registration Files\tOV_LOG\tOV_PRIV_LOG \novstatus  Map's  topology `_item OpenView ITO related Software installed:` \n`swlist -l product|grep -E 'ITO|OPC'|grep -v PHSS|sort`\n `_item OpenView ITO related Patches installed:` \n`swlist -l product|grep -E 'ITO|OPC'|grep PHSS|sort`\n `_itostatus` `_snmp` `_ovobjprint` \n" _ito_conf_files } function _itostatus { echo "`_item OpenView ITO Status:`\n

    \n`_item opcsv -status`\n\n`$OV_BIN/OpC/opcsv -status`
    \n`_item opcagt -status`\n\n`$OV_BIN/OpC/opcagt -status`
    " } function _nnmindex { _heading OpenView NNM _item NNM Version: _nnmversion echo "

    NNM Information " } function _itoindex { _heading OpenView ITO _item OpenView ITO Version: _itoversion echo "

    OpenView ITO Information " } function _licensing { echo "   License " >> \ $OUT_DIR/index.html _title Licensing \"Fun\" echo "\tPlease make sure that PHSS_8508 is installed, and, if you don't rely on floating licenses, consider switching to a nodelock'd license type, as this appears to be more robust.

    Starting with rev. 5.01 OpenView Network Node Manager will be delivered with a nodelock license as the default license, for almost all other products there's a chance to convert the floating license into a nodelocked license. The following products are currently eligible for converting: IT/A, IT/O, Omnistorage, NNM 4.x, DM 4.2, OPI 4.2/5.x, TMN 5.x, NetMetrix Load Monitor/NFS/Protocol Analayzer/Internetwork Monitor/Reporter/IRM.

    Contact your local Response Center for further details.

    " _cat_file $OV_NODELOCK/nodelock _cat_file $OV_CONF/nnmlicense|grep -v "^#" I4LS_BIN=/opt/ifor/ls/os/hpux/bin echo "`_item what $I4LS_BIN/i4admin:`\n

            `what $I4LS_BIN/i4admin`
            \n\n`_item $I4LS_BIN/i4target -v:`
            `$I4LS_BIN/i4target -v`
            \n\n`_item i4tv:`
            \n`$I4LS_BIN/i4tv`
            \n\n`_item i4lbfind:`
            \n`$I4LS_BIN/i4lbfind 2> $LOGFILE`
            \n\n`_item cat /etc/rc.config.d/iforls:`
            `cat /etc/rc.config.d/iforls|grep -v ^#`
            \n`_item cat /etc/rc.config.d/ncs:`
            \n`cat /etc/rc.config.d/ncs|grep -v ^#`"
            _footer
    }
    
    function _tmnindex {
            _heading OpenView
            _item TMN Version:
            _nnmversion
            echo "

    TMN Information     NNM Information " } function _nnm_conf_files { _copy_file $OV_CONF/ovwdb.auth nnm.conf _copy_file $OV_CONF/ovw.auth nnm.conf _copy_file $OV_CONF/oid_to_type nnm.conf _copy_file $OV_CONF/polling nnm.conf _copy_file $OV_CONF/ovsnmp.conf nnm.conf _copy_file $OV_CONF/snmpCol.conf nnm.conf _copy_file $OV_CONF/oid_to_sym/nnm.conf _copy_file $OV_CONF/C/oid_to_sym nnm.conf _copy_file $OV_CONF/C/filters nnm.conf if [ -f $OV_CONF/ovsuf ] ; then grep '^0:' $OV_CONF/ovsuf > $OUT_DIR/nnm.conf/ovsuf.out fi cp $OV_LRF/*.lrf $OUT_DIR/lrf.conf } function _ito_conf_files { _copy_file $OV_BIN/OpC/install/opcsvinfo nnm.conf _copy_file $OV_BIN/OpC/install/opcinfo nnm.conf _copy_file /var/opt/OV/conf/OpC/nodeinfo nnm.conf _copy_file $OV_CONF/OpC/mgmt_sv/opc.hosts nnm.conf _copy_file $OV_CONF/ovdbconf nnm.conf _copy_file /var/opt/OV/tmp/OpC/trace nnm.conf/ito.trace _copy_file /var/opt/OV/share/tmp/OpC/mgmt_sv/trace nnm.conf/ito.trace.mgmt } function _nnmversion { mkdir -p $OUT_DIR/nnm.conf mkdir -p $OUT_DIR/lrf.conf if [ -f $OV_BIN/ovnnmversion ]; then $OV_BIN/ovnnmversion; elif [ -f $OV_BIN/ovw ]; then what $OV_BIN/ovw | grep "HP OpenView" else # this shouldn't happen, neverever echo "no NNM installed, but ov.envvars.sh exists, why?"; fi } function _itoversion { if [ -f $OV_BIN/OpC/opc ]; then what $OV_BIN/OpC/opc | grep "HP OpenView" else # this shouldn't happen echo "no OpenView ITO installed"; fi } function _snmp { echo "

    \n`_item xnmsnmpconf -opt`\n`xnmsnmpconf -opt`
    " if [ -f $OV_LOG/snmpCol.trace ]; then mv $OV_LOG/snmpCol.trace $OV_LOG/snmpCol.trace.old > /dev/null 2>&1 fi snmpCollect -S > /dev/null 2>&1 cp $OV_LOG/snmpCol.trace $OUT_DIR/nnm.conf } function _ovobjprint { _item ovobjprint -S echo "
    \n`$OV_BIN/ovobjprint -S`\n
    " } function _ovtopo { echo "`_title Topology`\n
            \n`_item ovtopodump -l -v`\n\n`$OV_BIN/ovtopodump -l -v`\n
            \n`_item xnmtopoconf -print`\n\n`$OV_BIN/xnmtopoconf -print`\n
    \n" } function _mapinfo { echo "`_title Map Information`\n
    \n
            `_item ovwls -a -G`\n`ovwls -a -G`\n
            `_item ovmapdump -l -v`\n`ovmapdump -l -v`\n
    \n" } ### OV Telecom Stuff ### function _tmn { _title TMN Information echo "`_item TMN Version:``_nnmversion`  

    Local Registration Files   Log files ovstatus   osiconfcheck -bd   ovsuf   odbc.ini   ovors

    `_cat_file $OV_CONF/local_p_addr` `_item what pmd`\n

    \n`what $OV_BIN/pmd`\n
    `_item ovconftest`\n
    `ovconftest`
            

     \n" _ovors > $OUT_DIR/ovors.html _osiconfcheck > $OUT_DIR/osiconfcheck.html _ovsuf > $OUT_DIR/ovsuf.html _odbc > $OUT_DIR/odbc.html } function _odbc { _title odbc.ini _cat_file /.odbc.ini } function _ovsuf { _title ovsuf _cat_file $OV_CONF/ovsuf } function _osiconfcheck { _title osiconfchk -bd _item osiconfchk -bd osiconfchk -bd _item otsstat otsstat } function _ovstatus { _title ovstatus _item ovstatus $OV_BIN/ovstatus } function _ovors { echo "`_title ovors`\n`_cat_file $OV_CONF/ovors` `_item ovorsutil -s`\n

    \n`ovorsutil -s`\n
    \n `_item ovorsutil -h`\n
    \n`ovorsutil -h`\n
    \n" } ### SNA ### function _sna { SNA_BIN=/opt/sna/bin if [ -f $SNA_BIN/snapsysinfo ]; then VER=`what /stand/vmunix|grep SNA|awk '{print $3}'|sort -u` echo "\t\t * SNA" mkdir $OUT_DIR/SNA FILE=$OUT_DIR/SNA/index.html _heading SNA >> $OUT_DIR/index.html echo "Version: $VER, more Info ">> $OUT_DIR/index.html echo "`_title SNA`\n`what /stand/vmunix|grep -i sna`

    \nsnapsysinfo

    \nError and Audit files collected

    \nsnapconfig\n" > $FILE _snapsysinfo > $OUT_DIR/SNA/snapsysinfo.html _snapconfig > $OUT_DIR/SNA/snapconfig.html _snaerr > $OUT_DIR/SNA/snaerr.html echo "\n\n

    \n" >> $FILE fi } function _snapsysinfo { _title snapsysinfo $SNA_BIN/snapsysinfo } function _snaerr { _title SNAerrors _item /var/opt/sna/sna.aud cat /var/opt/sna/sna.aud _item /var/opt/sna/sna.err cat /var/opt/sna/sna.err _footer } function _snapconfig { _title snapconfig if [ -f $SNA_BIN/snaptextcfg ]; then $SNA_BIN/snaptextcfg else cat /etc/opt/sna/sna_node.cfg echo "

    `_item sna_domn.cfg`

    " cat /etc/opt/sna/sna_domn.cfg fi _footer } function _sg { if [ -f /usr/sbin/cmviewcl ]; then echo "\t\t * Service Guard" mkdir $OUT_DIR/SG FILE=$OUT_DIR/SG/index.html _heading ServiceGuard >> $OUT_DIR/index.html echo "Version: `swlist -l product|grep \"^ ServiceGuard\"|awk '{print $2}'`, more Information " >> $OUT_DIR/index.html echo "`_title ServiceGuard`\n`what /stand/vmunix|grep -i service`

    \nnetstat information    SG Entries in /etc/services

    \ncm commands:

    \ncmviewcl    cmgetconf    cmscancl\n\n\n

    \n\n\n`_item /etc/rc.config.d/cmcluster` \n`cat /etc/rc.config.d/cmcluster``_footer`" > $FILE echo "`_title Netstat Information` `_item netstat -a | grep hacl``_item netstat -a` \n`netstat -a | grep hacl`" > $OUT_DIR/SG/sgnetstat.html if [ $OS -eq 10 ]; then echo "`_item netstat -AAA` \n`netstat -AAA`" >> $OUT_DIR/SG/sgnetstat.html fi echo "`_title hacl entries in /etc/services` `_item grep hacl /etc/services` \n`grep hacl /etc/services`" > $OUT_DIR/SG/sgservices.html echo "`_title cmviewcl` `_item cmviewcl` \n`cmviewcl -v`" > $OUT_DIR/SG/cmviewcl.html echo "`_title cmgetconf` `_item cmgetconf` \n`cmgetconf -v`"> $OUT_DIR/SG/cmgetconf.html echo "`_title cmscancl` `_item cmscancl`\n\n \n`cmscancl`\n\n\n`_cat_file /tmp/scancl.out"> $OUT_DIR/SG/cmscancl.html fi } function _java { _title Java Installation _item Java Revision _javaversion _item swlist | grep -i java swlist | grep -i java swlist -l product | grep -i java swlist -l product | grep -i java _footer } function _javaversion { echo " `swlist | grep -i java | awk '{print $2}'`
    " echo "

    Environment variables
    " } ########################################## # # # # # OCMP Telecom Infrastructure Division # # # # # ########################################## function _ocmpindex { _heading OpenCall Media Platform _item OpenCall Media Platform Version echo "
    " _ocmpversion echo "

            `ioscan -fnk| grep Description`
            `ioscan -fnk| grep ===========`
            `ioscan -fnk| grep sonet`
            
    " echo "

    OpenCall Media Platform Information
     " } function _ocmpversion { if [ -f $OOB/OCMedia ]; then echo "`swlist| grep -i netaction | awk '{print $2}'`" else echo "OpenCall not installed with netaction depots" fi } function _ocmpsoft { _title OpenCall Software Information _item OpenCall Media Platform Version: _ocmpversion echo "


    " _item OpenCall related Software installed: swlist |grep -i OC | grep -v Patch |sort echo "
    " _item OpenCall related Patches installed: swlist | grep -i OC | grep -i Patch |sort _footer } function _ocmplist { _title System core files _item from / core files \(nice\) find / -name core -exec ll {} \; echo "" _title OCMP Directory listings echo "/opt/OCMP
    " echo "/etc/opt/OCMP
    " echo "/var/opt/HP-AIN

    " echo "" _item /opt/OCMP/ ls -laR /opt/OCMP/ echo "
    " echo "
    top
    " echo "" _item /etc/opt/OCMP/ ls -laR /etc/opt/OCMP/ echo "
    " echo "
    top
    " echo "" _item /var/opt/HP-AIN/ ls -laR /var/opt/HP-AIN/ echo "top
    " _footer } function _ocmpproc { _title Processes _item ps tree export UNIX95=1 ps -H -ef |grep -v $MYTTY export UNIX95=0 _item top top -d1 | strings | grep -v 4b _item Uptime uptime _footer } function _ocmpconf { FILE=$OUT_DIR/ocmpconf.html echo "OCMP Configuration
    " echo "`_title OpenCall Software Configuration Information`" > $FILE echo " Initial configuration setup, Color, LPC, Default XML files.\n Installation Configuration
    OpenCall related software installed.\n OC Software
    User XML configuration and properties files\n User Defined Configuration
    OCMP directory listings\n Directory Listing
    System /etc/services\n /etc/services
    Active internet connections \( netstat \) \n netstat
    Dynamically Loadable Kernel Module Status\n kmadmin -s
    Platform trace and log files\n Logs and Trace files
    Java Software\n Java Software
    Running Processes\n Running Processes
    " >> $FILE } function _ocmpinfo { _title OCMP Information if [ -f /etc/opt/OCMP/OCMP.setup ]; then LPC=`cat /etc/opt/OCMP/OCMP.setup | grep ISUP_LPC | cut -d"=" -f2` _item Local Point Code: echo "$HOST : lpc : $LPC
    " fi _title2 Software Configuration _item OCMP Installed Version: echo "
    " _ocmpversion _ocmpconf echo "
    " _title2 Hardware _item ioscan -fnkC sonet ioscan -fnkC sonet echo "

    " _title2 tmcDiag if [ -f $OOB/SonetSDHCardIsRunning ]; then echo "Note:
    SonetSDHCardIsRunning
    " echo "Not executing tmcDiag
    " else echo "Note: The SonetSDHCard NOT running
    " echo "It is safe to tmcDiag
    " _item tmcDiag for CARD in `ioscan -fnkCsonet|grep -v "==="|grep -v dev|grep -v Driver|awk '{print $2}'` do echo "Sonet Card Instance: $CARD
    " /opt/OCMP/bin/tmcDiag -M $CARD echo "


    " done fi echo "

    " _footer } function _ocmpcollectconf { ll /etc/opt/OCMP/Network/Global/*.xml> /tmp/listing_of_xml_config_files FILE1=$OUT_DIR/ocmpsetup.html FILE2=$OUT_DIR/ocmpuser.html FEBE=`cat /etc/opt/OCMP/OCMP.runinfo|grep SS7_FEBE_TYPE|cut -d"=" -f2` echo "`_title OpenCall Software Configuration` `_cat_file /etc/opt/OCMP/OCMP.runinfo` `_cat_file /etc/opt/OCMP/OCMP.setup`" > $FILE1 echo "`_title2 OCMP.properties`\n" >> $FILE1 echo "
    /etc/opt/OCMP/OCMP.properties html format
    " >> $FILE1 echo "`_footer`" >> $FILE1 echo "`_title OpenCall User Configuration` `_item XML Config` Platform configuration : /etc/opt/OCMP/\n"> $FILE2 if [[ $FEBE = "SingleHost" ]]; then echo "`_title2 FTC: SingleHost Configuration`\n `_cat_file /etc/opt/OCMP/ocmp_ftc.conf`" >> $FILE2 else echo "`_title2 FTC: FEBE Configuration`\n `_cat_file /etc/opt/OCMP/ocmp_be_ftc.conf`" >> $FILE2 fi echo "\n`_cat_file /tmp/listing_of_xml_config_files`\n">> $FILE2 rm /tmp/listing_of_xml_config_files echo "`_footer`" >> $FILE2 } function _ocmptrace { ISUPCOLOR=`cat /etc/opt/OCMP/OCMP.setup|grep OC_MEDIA_ISUP_COLOR|cut -d"=" -f2` _title OpenCall Traces and Logs if [[ $ISUPCOLOR = "ANSI" ]] then _title2 ANSI ISUP Variant _item Trace mode: initANSIIsupOCMedia.bsh echo "The following setting determines the following logging:
    a\) nettl traces and logs
    b\) traces and logs on the stdout
    " cat /etc/opt/OCMP/initANSIIsupOCMedia.bsh | grep TracerConfig elif [[ $ISUPCOLOR = "ITU" ]]; then _title2 ITU ISUP Variant echo "The following setting determines the following logging:
    a\) nettl traces and logs
    b\) traces and logs on the stdout
    " _item Trace mode: initITUIsupOCMedia.bsh cat /etc/opt/OCMP/initITUIsupOCMedia.bsh | grep TracerConfig else _item ISUP Color echo "ERROR: Unrecognised ISUP Variant: $ISUPCOLOR
    " fi _title2 nettl traces echo "


    " echo "/var/opt/HP-AIN/ttl/trace.TRC0

    " echo "

    " echo "/var/adm/nettl.LOG00

    " _title2 LOG.OCMP echo "The stdout and stderr output redirections :
    " if [ -f /tmp/LOG.OCMP.1 ]; then _collect_file LOG.OCMP.1 /tmp/LOG.OCMP.1 else echo "NOTE: File not Found: /tmp/LOG.OCMP.1
    " fi if [ -f /tmp/LOG.OCMP.2 ]; then _collect_file LOG.OCMP.2 /tmp/LOG.OCMP.2 else echo "NOTE: File not Found: /tmp/LOG.OCMP.2
    " fi _footer } function _ocmpprop { if [ -f /etc/opt/OCMP/OCMP.properties ]; then PROPFILE=$OUT_DIR/OCMP/OCMP.properties TMP=$OUT_DIR/propertiestmp.tmp if [ -d $OUT_DIR/OCMP/ ]; then echo "" else echo "making $OUT_DIR/OCMP/
    " mkdir $OUT_DIR/OCMP/ fi if [ -f $OUT_DIR/OCMP/OCMP.properties ]; then echo "" else echo "Copying OCMP.properties to $OUT_DIR/OCMP/
    " cp -p /etc/opt/OCMP/OCMP.properties $OUT_DIR/OCMP/ fi cat /etc/opt/OCMP/OCMP.properties|grep file|grep -v webserver|grep config>$OUT_DIR/ocmptmp.tmp _title /etc/opt/OCMP/OCMP.properties > $TMP echo "
    "				>> $TMP
             cat /etc/opt/OCMP/OCMP.properties 	>> $TMP
             echo "
    " >> $TMP _footer >> $TMP for F in $(cat $OUT_DIR/ocmptmp.tmp) do VAL1=`echo $F | cut -d"=" -f1` OLD=`echo $VAL1 | sed "s/\//\\\//g"` VAL2=`echo $F | cut -d"=" -f2` VAL3=`echo $VAL2 | sed "s/\/etc\/opt\///g"` VAL4="$VAL2" #VALZ3=`echo $VAL4 | sed "s/\//\\\//g"` NEW="${VAL4}" sed "s;$VAL2;$NEW;g" $TMP > $OUT_DIR/properties.ocmp mv $OUT_DIR/properties.ocmp $TMP done VAL1="/etc/opt/OCMP/initITUIsupOCMedia.bsh" sed "s;"/etc/opt/OCMP/initITUIsupOCMedia.bsh";$VAL1;g" $TMP> $OUT_DIR/properties.ocmp mv $OUT_DIR/properties.ocmp $TMP mv $TMP $OUT_DIR/ocmpproperties.html rm $OUT_DIR/ocmptmp.tmp else echo "
    ERROR: File not Found: /etc/opt/OCMP/OCMP.properties
    " > $TMP mv $TMP $OUT_DIR/ocmpproperties.html fi } function _ocmptrc { if [ -f /var/opt/HP-AIN/ttl/trace.TRC0 ]; then _title netfmt -f /var/opt/HP-AIN/ttl/trace.TRC0 _item /var/opt/HP-AIN/ttl/trace.TRC0 /usr/sbin/netfmt -f /var/opt/HP-AIN/ttl/trace.TRC0 _footer else echo "
    NOTE: File not Found: /var/opt/HP-AIN/ttl/trace.TRC0
    " fi } function _ocmpxml { #parsing the xml for ie viewing typeset OLD='encoding="US-ASCII"' typeset NEW=' ' for F in $OUT_DIR/OCMP/Network/Global/*.xml do echo "" >> $F;echo "" >> $F;echo "" >> $F;echo "" >> $F sed "s/$OLD/$NEW/g" $F > ${F}.tmp grep -v 'DOCTYPE' ${F}.tmp > $F rm $F.tmp done typeset OLD='encoding="US-ASCII"' typeset NEW=' ' for F in $OUT_DIR/OCMP/Network/Empty/*.xml do echo "" >> $F;echo "" >> $F;echo "" >> $F;echo "" >> $F sed "s/$OLD/$NEW/g" $F > ${F}.tmp grep -v 'DOCTYPE' ${F}.tmp > $F rm $F.tmp done OLD='encoding="US-ASCII"' NEW=' ' for F in $OUT_DIR/OCMP/Services/Global/*.xml do echo "" >> $F;echo "" >> $F;echo "" >> $F;echo "" >> $F sed "s/$OLD/$NEW/g" $F > ${F}.tmp grep -v 'DOCTYPE' ${F}.tmp > $F rm $F.tmp done typeset OLD='encoding="US-ASCII"' typeset NEW=' ' for F in $OUT_DIR/OCMP/Services/Empty/*.xml do echo "" >> $F;echo "" >> $F;echo "" >> $F;echo "" >> $F sed "s/$OLD/$NEW/g" $F > ${F}.tmp grep -v '^ $F rm $F.tmp done typeset OLD='encoding="US-ASCII"' typeset NEW=' ' for F in $OUT_DIR/OCMP/*.xml do echo "" >> $F;echo "" >> $F;echo "" >> $F;echo "" >> $F sed "s/$OLD/$NEW/g" $F > ${F}.tmp grep -v '^DOCTYPE' ${F}.tmp > $F rm $F.tmp done typeset OLD='encoding="US-ASCII"' typeset NEW=' ' for F in $OUT_DIR/OCMP/*.xml do echo "" >> $F;echo "" >> $F;echo "" >> $F;echo "" >> $F sed "s/$OLD/$NEW/g" $F > ${F}.tmp grep -v 'DOCTYPE' ${F}.tmp > $F rm $F.tmp done echo "\n\tOCMP xml files processed for ie\n" } _init $* echo '\007\c'