您的位置:首页 > 其它

HP-UX 主机巡检-nickel 脚本命令细细读--系统信息

2013-05-06 15:30 435 查看
nickel脚本请见附件:

一、系统信息:

用与收集系统所有软硬件信息:

1、系统信息 system information

使用命令: /usr/contrib/bin/machinfo

说明:这个是nickel生成的index.html文件首页的内容,包括了CPU、内存、Firmware、Platform、OS、信息

2、启动时间 uptime

使用命令: uptime

说明:机器启动到现在的天数

3、环境变量

使用命令: env

4、文件系统和磁盘信息

1)显示启动盘上的LIF信息:

使用命令: lifls -il /dev/rdsk/c0t6d0s2

命令显示:

lifls -il /dev/rdsk/c0t6d0s2

volume ISL10 data size 7984 directory size 8 06/10/27 14:23:07

filename type start size implement created

===============================================================

ISL -12800 584 242 0 06/10/27 14:23:07

AUTO -12289 832 1 0 06/10/27 14:23:07

HPUX -12928 840 1024 0 06/10/27 14:23:07

PAD -12290 1864 1468 0 06/10/27 14:23:07

LABEL BIN 3336 8 0 09/11/05 22:41:22

HP-UX系统启动过程:

参见:http://fanqiang.chinaunix.net/a1/b6/20011121/0808001581.html

hpux的启动过程概况如下:

pdc(Processor-dependent-code,在rom中,完成硬件自检

| 读取stable storge中的信息,如autosearch,

| primarypath等等,然后调用isl

isl (Initial system loader,在boot盘的lif区域。lif

| 区域主要有四个文件,分别是sl,hpux,AUTO,LABEL

| 在#下,可以使用lifls命令察看,同时可以使用

| lifcp 察看AUTO的内容。

| isl的主要任务是执行lif区域的hpux,同时也可

| 以改变stable storge中的部分信息,如

| primarypath,autoboot等等

hpux 引导os,主要是读取/stand/vmunix文件,同时把

| 控制权交给内核,

|

init 从这里开始,就是软件之间的启动了

说明:显示LIF卷上的文件信息 ,相关LIF的文章,请看:http://hi.baidu.com/penguinhe2006/blog/item/470c153d3047cae33c6d97b0.html

2)显示系统lvm信息:

使用命令:vgdisplay -v ; strings /etc/lvmtab

3)显示启动卷信息:

使用命令:lvlnboot -v

4)系统mount情况 :

使用命令:cat /etc/fstab ; mount -p

5)分区可用空间:

使用命令: bdf -i

6)NFS mount :

使用命令: showmount -a

7)SWAP 信息:

使用命令: swapinfo -tam

5、系统软件及补丁安装情况:

使用命令:swlist -l bundle ; swlist -l product ; swlist -l product | grep PH ; swlist -l fileset -a state -a patch_state

6、启动盘设备path 信息:

使用命令:setboot

7、计划任务情况:

使用命令: crontab -l

8、磁盘IO 情况:

使用命令:iostat -t 5 2

9、IPC 情况:

使用命令:ipcs -bcop

10、内核加载的设备驱动

使用命令:lsdev

11、nfs情况

使用命令:nfsstate

12、进程情况:

使用命令:ps -ef

13、系统负载情况:

使用命令:sar -A 5 2

14、系统重启日志:

使用命令: cat /var/adm/shutdownlog

15、系统内核参数情况:

使用命令:cat /stand/system; kctune ; kcusage; sysdef

16、系统日志:

使用命令:cat /var/adm/syslog/syslog.log ; cat /var/adm/syslog/OLDsyslog.log

17、top信息

使用命令: top -d5

18、vmstat 信息:

使用命令:vmstat -dS 5 2

19、内核具体信息:

使用命令:what /stand/vmunix

#!/sbin/sh

#

# #### $ Revision: A.01.12b15 $ $ Author: Robert Sakic $ $ Date: December 2002 $

# @(#) $ Rev: A.01.12b15-001 $ $ Modified by: Liew Teck Yuen (tyliew@hp.com) $

# Modified Rev : A.01.12b15-001

# Modified By : Liew Teck Yuen (tyliew@hp.com,tyliew@yahoo.com)

# Last Modified : 06 Jun 2006

#

###############################################################################

#

# 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 - 2002 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.

#

###############################################################################

### Start: Added by tyliew@hp.com

PWD1=`pwd`

if [[ $PWD1 = "/" ]]

then

PWD1=""

fi

TMP_DIR=/tmp

OUT_DIR=$TMP_DIR/$BASE.$HOST

### End: Added by tyliew@hp.com

BASE=`basename $0`

HOST=`hostname`

MYTTY=`who am i | awk '{print $2}'`

### Start: Remarked by tyliew@hp.com

### OUT_DIR=/tmp/$BASE.$HOST

### End: Remarked by tyliew@hp.com

### Start: Added by tyliew@hp.com

PWD=`pwd`

TMP_DIR=/tmp

OUT_DIR=$TMP_DIR/$BASE.$HOST

### End: Added by tyliew@hp.com

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 <email address> | -o <output directory> | -n | -? ]\n\nOptions:\n\t-m <email address>\tEmail the archive to <email address>\n\t-o <output directory>\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

### Start: Remarked by tyliew@hp.com

### 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."

### End: Remarked by tyliew@hp.com

### Start: Added by tyliew@hp.com

echo "Nickel Revision: `grep Rev: $0|grep -v awk|awk '{print $5}'`"

echo "\n\tNote, the Temporary Output will go to the following Directory:

$OUT_DIR

\n\tPoint your favourite Web browser to that directory and

open the file index.html to see the results.

\n\tFinal Archived File:

$PWD1/$BASE.$HOST.tar.gz"

### End: Added by tyliew@hp.com

mkdir $OUT_DIR

LOGFILE=$OUT_DIR/nickel.log

}

### HTML functions start here ###

function _heading {

echo "<P><P>\n<CENTER><TABLE WIDTH="100%">

<TR><TD align=center bgcolor=$HCOL><B>

<FONT FACE="Helvetica, Arial" SIZE=+2 COLOR=$FCOL2>$1 $2 $3 $4 $5</FONT>\n</TABLE></CENTER><P>"

}

function _footer {

echo "</PRE>\n</BODY></HTML>"

}

function _item {

echo "<BR><B><FONT COLOR=$FCOL>$1 $2 $3 $4 $5 $6 $7</FONT></B>"

}

function _title {

echo "<HTML><HEAD><TITLE>`basename $1` $2 $3 $4 $5</TITLE></HEAD>

<BODY BGCOLOR=$BGCOL>"

_heading `basename $1` $2 $3 $4 $5

echo "\n<PRE>"

}

function _title2 {

echo "<HTML><HEAD><TITLE>`basename $1` $2 $3 $4 $5</TITLE></HEAD>

<BODY BGCOLOR=$BGCOL>"

_heading2 `basename $1` $2 $3 $4 $5

echo "\n<PRE>"

}

##############################################################################

#

# 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 {

NICKEL_UPTIME=`uptime|awk '{print $3,$4,$5}'|sed s/,$//|cut -d ' ' -f3`

if [ `echo $NICKEL_UPTIME | grep :` ]; then

NICKEL_TIME_FORMAT="Hour(s)"

else

NICKEL_TIME_FORMAT="Minute(s)"

fi

echo "<HTML><HEAD><TITLE>System Information for $HOST</TITLE></HEAD>

<BODY BGCOLOR=$BGCOL>\n<CENTER><TABLE WIDTH="100%">\n

<TR><TD align=center bgcolor=$HCOL><B>

<FONT FACE="Helvetica, Arial" SIZE=+2 COLOR=$FCOL2>

System Information</FONT><FONT SIZE=+2> for

<FONT COLOR=$FCOL2>$HOST</FONT><BR> `date`</B></FONT></TD></TR>

<TR><TD align=right><FONT FACE="Helvetica, Arial" SIZE=-1><B>

Nickel Rev: `grep Rev: $0 | grep -v awk | awk '{print $5}'`

</B></FONT></TD></TR>

</TABLE></CENTER>

<P>\n<TABLE><TR>"

if [[ -f /usr/contrib//bin/machinfo ]]; then

echo "<TD COLSPAN=3><B><FONT COLOR=$FCOL>

Machine Information:</FONT></B><PRE>`machinfo`</PRE></TD></TR>

<TR>\n<TD><B><FONT COLOR=$FCOL>Uptime:</FONT></B>

`uptime|awk '{print $3,$4,$5}'|sed s/,$//` $NICKEL_TIME_FORMAT</TD>

<TD> </TD><TD> </TD>"; else

echo "<TD><B><FONT COLOR=$FCOL>OS:</FONT></B>" "`uname -r`", "`echo $NUMBEROFBITS`" "

<TD><B><FONT COLOR=$FCOL>HW:</FONT></B>" "`model -D`

<TD><B><FONT COLOR=$FCOL>RAM:</FONT></B>" "`_ram`

</TR><TR>\n<TD><B><FONT COLOR=$FCOL>Uptime:</FONT></B>

`uptime|awk '{print $3,$4,$5}'|sed s/,$//` $NICKEL_TIME_FORMAT

<TD><B><FONT COLOR=$FCOL>CPU:</FONT></B> " "`_mhz`", "

`_cpuversion`", "

`_cpurevision`</TD><TD></TD>"; fi

echo "</TR></TABLE><P></P>

<TABLE SIZE=100%><TR>

<TD><A HREF="environment.html">Environment</A> </TD>

<TD><A HREF="fs-disk.html">Filesystem/Disk Info</A> </TD>

<TD><A HREF="software.html">Installed Software</A> 

<A HREF="software_logfiles.html">(logfiles)</A> </TD>

</TR></TABLE><BR>

`_create_link $USBIN/setboot`

`_create_link $UBIN/crontab -l`

`_create_link $USBIN/dmesg`

`_graphinfo`

`_create_link $UBIN/iostat -t $IO_INT $IO_COUNT`

`_create_link $UBIN/ipcs -bcop`

<A HREF="java.html">Java</A>

`_create_link3 $USBIN/kmadmin -k`

`_create_link3 $USBIN/kmadmin -S`

`_create_link4 $USBIN/kmadmin -s`

`_create_link $UBIN/locale`

`_create_link $USBIN/lsdev`

`_collect_file mail.log /var/adm/syslog/mail.log`

`_create_link $UBIN/nfsstat`

`_create_link $UBIN/ps -ef`

`_create_link $UBIN/sar -A $SAR_t $SAR_n`

<A HREF="sendmail.html">sendmail</A> 

`_collect_file shutdownlog /var/adm/shutdownlog`

`_stand_system`"

if [[ -f $USBIN/kctune ]]; then

echo "`_create_link $USBIN/kctune`"; else

echo "`_create_link $USBIN/kmtune`"; fi

echo "`_collect_file makrec.log1 /var/opt/ignite/logs/makrec.log1`

`_collect_file recovery.log /var/opt/ignite/recovery/latest/recovery.log`

`_create_link $USBIN/sysdef`

`_collect_file syslog /var/adm/syslog/syslog.log`

`_collect_file OLDsyslog /var/adm/syslog/OLDsyslog.log`

`_create_link $UBIN/top -d1`

`_title top > $OUT_DIR/top.html`

`$UBIN/top -d1 -n200 -f $OUT_DIR/top.html`

`_footer >> $OUT_DIR/top.html`

`_create_link $UBIN/vmstat -dS $VM_INT $VM_COUNT`

`_create_link $UBIN/what /stand/vmunix`

`_heading Hardware / Diagnostic`

`_create_link $USBIN/ioscan -fn`

`_tombstones`

`_diskinfo`

`_diag_proc`

`_cstm $USBIN/cstm`

`_collect_file event.log /var/opt/resmon/log/event.log`

`_heading OS`

`_collect_file auto_master /etc/auto_master`

`_collect_file auto_parms /etc/auto_parms.log`

`_collect_file cmcluster.conf /etc/cmcluster.conf`

`_collect_file exports /etc/exports`

`_collect_file hosts /etc/hosts`

`_collect_file hosts.equiv /etc/hosts.equiv`

`_collect_file rhosts /.rhosts`

`_collect_file inittab /etc/inittab`

`_collect_file ntp.conf /etc/ntp.conf`

`_collect_file rc.log /etc/rc.log`

`_collect_file rc.log.old /etc/rc.log.old`

`_collect_file securetty /etc/securetty`

`_collect_file syslog.conf /etc/syslog.conf`

`_collect_file TIMEZONE /etc/TIMEZONE`

`_heading Network`

\n<B><FONT COLOR=$FCOL>lanscan:</FONT></B>

<PRE>`lanscan`</PRE><BR>

<A HREF="network.html">Network Information</A><P><BR>"

}

function _create_link {

if [ -x $1 ]; then

if [ -f $1 ]; then

NAME=`basename $1`

echo "<A HREF=\"$NAME.html\">$NAME $2</A>  "

_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 "<A HREF=\"$NAME.html\">$NAME $2</A>  "

_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 "<A HREF=\"$NAME$2.html\">$NAME $2</A> "

_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 "<A HREF=\"${NAME}_$2.html\">$NAME $2</A> "

_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 "<A HREF=\"$BASE_all\">$1</A>"

fi

cp -R $1 $OUT_DIR

}

function _cat_file {

if [ -f $1 ]; then

echo "<P>`_item $1`\n

<PRE>\n`cat $1`\n</PRE>\n"

fi

}

function _common {

echo "Nickel StartUp"

_make_directory

echo "\n\tCollecting System Information..."

_index_html > $OUT_DIR/index.html

_hfsinfo > $OUT_DIR/hfsinfo.html

echo "\n\tVerifying Filesystem/Disk Information..."

_fsdisk > $OUT_DIR/fs-disk.html

echo "\n\tChecking Installed Software..."

_installed_software > $OUT_DIR/software.html

_software_logfiles > $OUT_DIR/software_logfiles.html

_sendmail > $OUT_DIR/sendmail.html

echo "\n\tCollecting Network Information..."

_laninfo > $OUT_DIR/network.html 2>&1

_environment > $OUT_DIR/environment.html

echo "\n\tChecking Java..."

_java > $OUT_DIR/java.html

echo "\n\tChecking for Optional Software..."

# 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 SuperDome, OpenCall, OpenMail, OmniBack,\n\t\t\tMC/SG, ORB, ISDN, X25, SNA..."

_parstatus # check if system has npars, show some information...

_vparstatus # check if system has vpars...

_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 ?

_fibre_channel # FC Adapter

# _y2k # Year 2000 Check ! - obsolete per default as of nov 2002

echo "<BR> <BR><HR><FONT SIZE=-1 color=$FCOL2>`what $0`</font>

</FONT></BODY></HTML>" >> $OUT_DIR/index.html

if [ ${SHAR} = YES ]; then

echo "\n\n"

### Start: Remarked by tyliew@hp.com

### tar cvf ${BASE}.${HOST}.tar ${OUT_DIR}

### End: Remarked by tyliew@hp.com

### Start: Added by tyliew@hp.com

cd $TMP_DIR

rm -f ${BASE}.${HOST}.tar

tar cvf ${PWD1}/${BASE}.${HOST}.tar ${BASE}.${HOST}

cd $PWD1

rm -f ${BASE}.${HOST}.tar.gz

### End: Added by tyliew@hp.com

gzip -9 ${BASE}.${HOST}.tar

#rm -rf $OUT_DIR

### Start: Remarked by tyliew@hp.com

## echo "\n\tCreated archive file: $BASE.$HOST.tar.gz"

### End: Remarked by tyliew@hp.com

### Start: Added by tyliew@hp.com

echo "\n\tCreated Archive File:\n\t$PWD1/$BASE.$HOST.tar.gz"

### End: Added by tyliew@hp.com

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 "</PRE><table cellpadding=9><tr>

<td><A HREF=\"#_iconf\">inetd.conf</A></td>

<td><A HREF=\"#_isec\">inetd.sec</A></td>

</table><HR><PRE>\n<A NAME=\"_iconf\">"

_cat_file /etc/inetd.conf

echo "\n<HR>\n<A NAME=\"_isec\">"

_cat_file /var/adm/inetd.sec

_footer

}

function _netfmt {

FILE=$OUT_DIR/netfmt.html

echo "<A HREF=netfmt.html>netfmt</A>"

### Start: Added by tyliew@hp.com

if [ -f /var/adm/nettl.LOG00 ] ; then

echo "`_title netfmt -f /var/adm/nettl.LOG00`" >> $FILE

echo "`_item /usr/sbin/netfmt -f /var/adm/nettl.LOG00`">> $FILE

echo "`/usr/sbin/netfmt -f /var/adm/nettl.LOG00`<P>" >> $FILE

else

echo "`_title netfmt -f /var/adm/nettl.LOG00`" >> $FILE

echo " /var/adm/nettl.LOG00 not found." >> $FILE

fi

### End: Added by tyliew@hp.com

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`<P>" >> $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 "<A HREF=\"$FILE\">/stand/system</A>  "

echo "`_title /stand/system`

`_cat_file /stand/system`

`_footer`" > $OUT_DIR/$FILE

}

function _collect_file {

if [ -f $2 ]; then

FILE=$1.html

echo "<A HREF=\"$FILE\">$1</A>  "

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

echo "<A HREF=\"$FILE1\">Diagnostics</A>  "

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

if [[ $OsRel = "10.01" || $OsRel = "10.10" || \

$OsRel = "10.20" || $OsRel = "11.00" || \

$OsRel = "11.11" ]]; then

FILE2=cstm_cpu.html

echo "<A HREF=\"$FILE2\">CPU Diagnostics</A>  "

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; fi

rm $OUT_DIR/cstm_i

fi

fi

}

function _diskinfo {

FILE=$OUT_DIR/diskinfo.html

echo "<A HREF=diskinfo.html>Diskinfo</A>  "

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 _lifinfo {

FILE=$OUT_DIR/lifinfo.html

echo "<A HREF=lifinfo.html>LIF info</A>  "

echo "`_title LIF directory contents`" > $FILE

echo "Information on root, boot, swap, and dump logical volumes:\n" >> $FILE

echo "\n`lvlnboot -v`\n\n" >> $FILE

for i in `ls /dev/rdsk/c*`

do

echo "lifls -il $i" >> $FILE

### Start: Remarked by tyliew@hp.com

### lifls -il $i >> $FILE

### End: Remarked by tyliew@hp.com

### Start: Added by tyliew@hp.com

lifls -il $i >> $FILE 2>&1

### End: Added by tyliew@hp.com

echo "\n" >> $FILE

done >> $FILE

echo "`_footer`" >> $FILE

}

function _tombstones {

if [ -f /var/tombstones/ts99 ]; then

FILE=$OUT_DIR/tombstones.html

echo "<A HREF=tombstones.html>tombstones</A>  "

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 "<A HREF=graphinfo.html>graphinfo</A>  "

echo "`_title graphinfo` Available Graphic devices:<BR>" > $FILE

# create links at top of page

for i in `ls /dev/crt*`

do

echo "<A HREF=#__$i>$i</A>" >> $FILE

done >> $FILE

# execute graphinfo for each device file found

echo "<P></P>\n<P></P>" >> $FILE

for i in `ls /dev/crt*`

do

echo "<A NAME="__$i"></A>`_item graphinfo $i`"

graphinfo $i 2>> $FILE

echo "\n" >> $FILE

done >> $FILE

echo "`_footer`" >> $FILE

fi

}

function _diag_proc {

FILE=diagproc.html

echo "<A HREF=\"$FILE\">Diag SW/Proc's</A>  "

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`<A HREF=services.html>/etc/services</A>\n\t"

_inetd > $OUT_DIR/inetd.html

echo "\t<A HREF=inetd.html>inetd.sec/conf</A>\t\t`_netfmt`<HR>

`_item lanscan`\n\n`lanscan`<HR>

`_item ioscan -fnC lan`\n`ioscan -fnC lan`<HR>

`_item ifconfig/ping/linkloop/nslookup for every LANIC`\n</PRE>\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 "<TABLE BORDER>\n<TR>\n<TH><B><FONT COLOR=$FCOL>$LANIC</FONT>:</B>

</TR>\n<TR>

<TD VALIGN=CENTER ALIGN=CENTER><B>ifconfig:</B>

<TD VALIGN=BOTTOM ALIGN=LEFT>

<PRE>`ifconfig $LANIC|sed 's/</\</'|sed 's/>/\>/`</PRE>

</TR>

`_linkloop $NMID $MACADDR $LINKLOOPIF`

`_lanadmin $NMID $LANIC`

`_ping $IPADDR`

`_nslookup $IPADDR`

`_nslookup $IFSHORT`

</TABLE>\n<P>"

done

echo "</BODY></HTML>"

}

function _linkloop {

if [[ $MACTYPE != "X25" && $MACTYPE != "FDDI" ]]; then

export INSTANCE=$3

if [[ $OS = "10" ]]; then

export INSTANCE=$1

fi

echo "<TR VALIGN=CENTER ALIGN=CENTER>

<TD><B>linkloop:</B>

<TD VALIGN=BOTTOM ALIGN=LEFT><PRE>`linkloop -i$INSTANCE $2`</PRE>

</TR>"

fi

}

function _gated {

echo "<A HREF="gated.html">gated information</A> "

echo "`_title gated`\n<P>`what /usr/sbin/gated`<P><HR><P>

`_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 "<TR VALIGN=CENTER ALIGN=CENTER>

<TD><B>lanadmin:</B>

<TD VALIGN=BOTTOM ALIGN=LEFT><PRE>`lanadmin -m $INSTANCE`\n`lanadmin -s $INSTANCE`\n`lanadmin -x $INSTANCE 2> $LOGFILE`</PRE>

</TR>"

fi

}

function _ping {

if [[ "$1" != "" && "$STATUS" -eq "1" ]]; then

echo "<TR VALIGN=CENTER ALIGN=CENTER>

<TD><B>ping:</B>

<TD VALIGN=BOTTOM ALIGN=LEFT><PRE>`ping $1 -n 3`</PRE>

</TR>"

fi

}

function _nslookup {

if [[ "$1" != "" && "$STATUS" -eq "1" ]]; then

echo "<TR VALIGN=CENTER ALIGN=CENTER>

<TD><B>nslookup<BR>$1</B>

<TD VALIGN=BOTTOM ALIGN=LEFT><PRE>`nslookup $1`</PRE>

</TR>"

fi

}

function _name_resolution {

echo "<A HREF="nameres.html">name resolution information</A> "

_title Name Resolution >> $OUT_DIR/nameres.html

if [ -f /etc/resolv.conf ] ; then

echo "`_item resolv.conf`\n`cat /etc/resolv.conf`<P>" \

>> $OUT_DIR/nameres.html

fi

if [ -f /etc/nsswitch.conf ] ; then

echo "<HR>\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</BODY></HTML>" >> $OUT_DIR/nameres.html

}

function _netstat {

echo "<A HREF=\"netstat.html\">netstat information</A>"

echo "\n`_title netstat`</PRE><table cellpadding=9>

<tr><td><A HREF=\"#_nrn\">netstat -rn</A></td>"> $OUT_DIR/netstat.html

if [ $OS != 11 ]; then

echo "<td><A HREF=\"#_nm\">netstat -m</A></td>">> $OUT_DIR/netstat.html

fi

echo "<td><A HREF=\"#_ns\">netstat -s</A></td>

<td><A HREF=\"#_an\">netstat -an</A></td></table>

<HR>\n<A NAME=\"_nrn\">`_item netstat -rn`

<PRE>`netstat -rn`</PRE><HR>" >> $OUT_DIR/netstat.html

if [ $OS != 11 ]; then

echo "<A NAME=\"_nm\"> `_item netstat -m` <PRE>`netstat -m` </PRE><HR>" >> $OUT_DIR/netstat.html

fi

echo "<A NAME=\"_ns\">`_item netstat -s` <PRE>`netstat -s` </PRE><HR>

<A NAME=\"_an\"> `_item netstat -an` <PRE>`netstat -an`</PRE><HR>

\n</BODY></HTML>" >> $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 -a show_superseded_patches=true"

SWSTRHTML="<td><A HREF=\"#_stat\">swlist -l fileset -a state -a patch_state"

else

SWSTRING="swlist -l fileset -a state"

SWSTRHTML="<td><A HREF=\"#_stat\">swlist -l fileset -a state"

fi

_title Installed Software

echo "Total Number of Patches installed: `swlist -l product|grep ' PH'|wc -l`

</PRE><table cellpadding=9><tr>

<td><A HREF=\"#_bund\">swlist -l bundle</A></td>

<td><A HREF=\"#_prod\">swlist -l product</A></td>

<td><A HREF=\"#_patch\">swlist -l product | grep PH</A></td>

$SWSTRHTML

</table>

<HR><PRE>\n<A NAME=\"_bund\">"

_item swlist -l bundle

swlist -l bundle

echo "<HR>\n<A NAME=\"_prod\">"

_item swlist -l product

swlist -l product

echo "<HR>\n<A NAME=\"_patch\">"

_item swlist -l product | grep PH

swlist -l product | grep PH

echo "<HR>\n<A NAME=\"_stat\">"

_item $SWSTRING

$SWSTRING

_footer

}

function _software_logfiles {

_title SDUX Logfiles

echo "

<A HREF=\"#_swagent\">/var/adm/sw/swagent.log</A><BR>

<A HREF=\"#_swagentd\">/var/adm/sw/swagentd.log</A><BR>

<A HREF=\"#_swconfig\">/var/adm/sw/swconfig.log</A><BR>

<A HREF=\"#_swinstall\">/var/adm/sw/swinstall.log</A><BR>

<A HREF=\"#_swmodify\">/var/adm/sw/swmodify.log</A><BR>

<A HREF=\"#_swremove\">/var/adm/sw/swremove.log</A><P>

<HR><PRE>\n<A NAME=\"_swagent\">"

_cat_file /var/adm/sw/swagent.log

echo "<HR>\n<A NAME=\"_swagentd\">"

_cat_file /var/adm/sw/swagentd.log

echo "<HR>\n<A NAME=\"_swconfig\">"

_cat_file /var/adm/sw/swconfig.log

echo "<HR>\n<A NAME=\"_swinstall\">"

_cat_file /var/adm/sw/swinstall.log

echo "<HR>\n<A NAME=\"_swmodify\">"

_cat_file /var/adm/sw/swmodify.log

echo "<HR>\n<A NAME=\"_swremove\">"

_cat_file /var/adm/sw/swremove.log

}

function _fsdisk {

_title Filesystem and Harddisk Information

echo "LIF Information: `_lifinfo`

\n<A HREF=\"lvminfo.html\">Logical Volume Manager Information</A>"

_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 $USBIN/swapinfo -tam`

\nDisplay current values contained in the primary super-block: <A HREF="hfsinfo.html">tunefs -v</A> 

\n`_create_link $UBIN/strings /etc/lvmtab`<BR></BR>"

_footer

}

function _lvminfo {

_title LVM Information

echo "General Information about LVM: `_create_link $USBIN/vgdisplay -v`, `_create_link $USBIN/lvlnboot -v`

<UL>

<LI>Number of available Logical Volumes: <B>`vgdisplay -v|awk '/LV Name/'|wc -l`</B></LI>

</LI><LI>Names of available Logical Volumes:<BR>"

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 "<A HREF=\"lvmdirectory$i.html\">$i</A> "

done

for k in `vgdisplay -v |awk '/LV Name/ && !/awk/ {print $3}'`

do

echo "</PRE>\n`_title Processing Logical Volume $i`

\n<font color=red>fstyp -v $k</font>" > $OUT_DIR/lvmdirectory$k.html

### Start: Remarked by tyliew@hp.com

### fstyp -v $k >> $OUT_DIR/lvmdirectory$k.html

### End: Remarked by tyliew@hp.com

### Start: Added by tyliew@hp.com

fstyp -v $k >> $OUT_DIR/lvmdirectory$k.html 2>&1

### End: Added by tyliew@hp.com

done

echo "</LI>

<LI>Number of available Volume Groups: <B>`vgdisplay|awk '/VG Name/'|wc -l`</B>

</LI><LI>Names of available Volume Groups:<BR>"

for i in `vgdisplay |awk '/VG Name/ && !/awk/ {print $3}'`

do

echo "<A HREF=\"lvmdirectory$i.html\">$i</A> "

done

echo "</LI></UL>"

for i in `vgdisplay |awk '/VG Name/ && !/awk/ {print $3}'`

do

echo "</PRE>\n`_title Processing Volume Group $i`

\n<font color=red>vgdisplay -v $i</font><PRE>"> $OUT_DIR/lvmdirectory$i.html

vgdisplay -v $i >> $OUT_DIR/lvmdirectory$i.html

echo "\n<PRE>\n<H3>Processing Logical Volumes of Volume Group $i</H3>" >> $OUT_DIR/lvmdirectory$i.html

for j in `vgdisplay -v $i |awk '/LV Name/ && !/awk/ {print $3}'`

do

echo "<font color=red>lvdisplay -v $j</font><PRE>"

lvdisplay -v $j

done >> $OUT_DIR/lvmdirectory$i.html

done

echo "\n<BR><UL>

\n<LI>Number of available Physical Volumes: <B>`vgdisplay -v |awk '/PV Name/'|wc -l`</B></LI>

<LI>Names of available Physical Volumes:<P></P>"

for i in `vgdisplay -v|awk '/PV Name/ && !/awk/ {print $3}'`

do

echo "<A HREF=\"lvmdirectory$i.html\">$i</A> "

done

echo "</LI></UL>"

for k in `vgdisplay -v |awk '/PV Name/ && !/awk/ {print $3}'`

do

echo "</PRE>\n`_title Processing Physical Volume $i`

\n<font color=red>pvdisplay -v $k</font>" > $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<HR>\n"

echo "<P><A HREF="nameres.html">Name Services</A> "

cp /etc/mail/* $OUT_DIR/sendmail.conf

echo "<A HREF="sendmail.conf">Config files</A> "

_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

<A HREF="orbplus.html">ORB Info</A> " >> $OUT_DIR/index.html

echo "`_title ORB Plus`\n<A HREF="orb.conf">Configuration files</A>\n<A HREF="orbadmin.html">orbadmin</A>`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`

</PRE>\n</BODY></HTML>

`_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 "<A HREF="isdn.html">more info</A>

 " >> $OUT_DIR/index.html

_title ISDN > $FILE

/opt/ISDN_SCSI/bin/isdninfo >> $FILE

echo "</PRE>\n</BODY></HTML>" >> $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 "<A HREF=om_basic.html>omenquire basic</A>  

<A HREF=om_unix.html>omenquire unix</A>

 " >> $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 _parstatus {

if [[ -f $USBIN/parstatus && `parstatus -s` -eq "0" ]]; then

FILE=$OUT_DIR/parstatus.html

echo "\t\t * nPar checking"

_heading nPar >> $OUT_DIR/index.html

echo "Output of the <A HREF=parstatus.html>parstatus</A> command   ">> $OUT_DIR/index.html

echo "`_title nPartition Status`

\nOutput of the <A HREF=\"#_parstat\">parstatus</A> command

\n<table>\n<tr>

<td><A HREF=\"#_pstat_PI\">Partition Information</A></td><td>   </td>

<td><A HREF=\"#_pstat_CI\">Cell Information</A></td><td>   </td>

<td><A HREF=\"#_pstat_BI\">Cabinet Information</A></td><td>   </td>

</tr>\n<tr>\n

<td><A HREF=\"#_pstat_1\">parstatus -X</A></td><td>   </td>

<td><A HREF=\"#_pstat_1a\">parstatus -w</A></td><td>   </td>

<td><A HREF=\"#_pstat_2\">parstatus -B</A></td><td>   </td>

<td><A HREF=\"#_pstat_3\">parstatus -V -b0</A></td><td>   </td>

<td><A HREF=\"#_pstat_4\">parstatus -I</A></td><td>   </td>

<td><A HREF=\"#_pstat_5\">parstatus -P</A></td><td>   </td>

</tr></table>\n\n<HR>\n<PRE>\n<A NAME=\"_parstat\">

\n`_item parstatus`\n\n`$USBIN/parstatus`

<HR>\n<A NAME=\"_pstat_PI\">\n<center><H2>Partition Information</H2></center><PRE>\n" > $FILE

for i in `parstatus -M -P | cut -d : -f 2`

do

echo "\n`_item parstatus -V -p $i`\n\n`parstatus -V -p $i`" >> $FILE

done

echo "\n<HR>\n<A NAME=\"_pstat_CI\">\n<center><H2>Cell Information</H2></center><PRE>\n" >> $FILE

for i in `parstatus -M -C|grep -v absent|cut -d: -f2|sed s/cab//|sed s:,cell:/:`

do

echo "\n`_item parstatus -V -c $i`\n\n`parstatus -V -c $i`" >> $FILE

done

echo "\n<HR>\n<A NAME=\"_pstat_BI\">\n<center><H2>Cabinet Information</H2></center><PRE>\n">> $FILE

for i in `parstatus -M -B|cut -d: -f2`

do

echo "\n`_item parstatus -V -b $i`\n\n`parstatus -V -b $i`" >> $FILE

done

echo "\n<HR><PRE>\n<A NAME=\"_pstat_1\">

\n`_item parstatus -X`\n\n`$USBIN/parstatus -X`

\n<HR><PRE>\n<A NAME=\"_pstat_1a\">

\n`_item parstatus -W`\n\n`$USBIN/parstatus -w`

\n<HR><PRE>\n<A NAME=\"_pstat_2\">

\n`_item parstatus -B`\n\n`$USBIN/parstatus -B`

\n<HR><PRE>\n<A NAME=\"_pstat_3\">

\n`_item parstatus -V -b0`\n\n`$USBIN/parstatus -V -b0`

\n<HR><PRE>\n<A NAME=\"_pstat_4\">

\n`_item parstatus -I`\n\n`$USBIN/parstatus -I`

\n<HR><PRE>\n<A NAME=\"_pstat_5\">

\n`_item parstatus -P`\n\n`$USBIN/parstatus -P`" >> $FILE

echo "\n</HR>

`_footer`" >> $FILE

fi

}

function _vparstatus {

if [ -f $USBIN/vparstatus ]; then

FILE=$OUT_DIR/vparstatus.html

echo "\t\t * vPar checking"

_heading vPar >> $OUT_DIR/index.html

echo "Output of the <A HREF=vparstatus.html>vparstatus</A> command   ">> $OUT_DIR/index.html

echo "`_title vPartition Status`

\nOutput of the <A HREF=\"#_vparstat\">vparstatus</A> command

\n<table>

\n<tr>

<td><A HREF=\"#_vpar_w\">vparstatus -w</A></td><td>   </td>

<td><A HREF=\"#_vpar_v\">vparstatus -v</A></td><td>   </td>

<td><A HREF=\"#_vpar_a\">vparstatus -A</A></td><td>   </td>

<td><A HREF=\"#_vpar_e\">vparstatus -e</A></td><td>   </td>

<td><A HREF=\"#_vpar_r\">vparstatus -R</A></td><td>   </td>

</tr>

</table>\n

\n<HR>\n<PRE>

\n<A NAME=\"_vparstat\">\n`_item vparstatus`\n`$USBIN/vparstatus`

\n<HR>\n<PRE>

\n<A NAME=\"_vpar_w\">\n`_item vparstatus -w`\n`$USBIN/vparstatus -w`

\n<HR>\n<PRE>

\n<A NAME=\"_vpar_v\">\n`_item vparstatus -v`\n`$USBIN/vparstatus -v`

\n<HR><PRE>

\n<A NAME=\"_vpar_a\">\n`_item vparstatus -A`\n`$USBIN/vparstatus -A`

\n<HR><PRE>

\n<A NAME=\"_vpar_e\">\n`_item vparstatus -e`\n`$USBIN/vparstatus -e`

\n<HR><PRE>

\n<A NAME=\"_vpar_r\">\n`_item vparstatus -R`\n`$USBIN/vparstatus -R`

\n\n" >> $FILE

echo "\n</HR>

`_footer`" >> $FILE

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

FILE3=$OUT_DIR/omni_ver_info.html

FILE4=$OUT_DIR/omni_status_info.html

OMNIBIN=/opt/omni/bin

OMNISBIN=/opt/omni/sbin

echo "\n\t\t * OmniBack"

_heading OmniBack / DataProtector >> $OUT_DIR/index.html

echo "Cell Server: <FONT COLOR=$FCOL>`cat /etc/opt/omni/cell/cell_server`   </FONT>" >> $OUT_DIR/index.html

echo "<A HREF=omni_status_info.html>Status info</A>   " >> $OUT_DIR/index.html

echo "`_title OmniBack II Status Information`<table><tr>

<td><A HREF=\"#_dbcheck\">omnidbcheck -extended</A></td>

<td><A HREF=\"#_status\">omnisv.sh -status</A></td>

<td><A HREF=\"#_query\">omnicc -query</A></td>

<td><A HREF=\"#_prevlast\">omnistat -prev -last 30</A></td>

<td><A HREF=\"#_devinfo\">omnidownload -dev_info</A></td>

<td><A HREF=\"#_detail\">omnidownload -list_libraries -detail</A></td>

</table>

\n<HR>

\n<A NAME=\"_dbcheck\">

\n`_item omnidbcheck -extended`

\n`$OMNISBIN/omnidbcheck -extended`

\n<HR>

\n<A NAME=\"_status\">

\n`_item omnisv.sh -status`

\n`$OMNISBIN/omnisv.sh -status < /dev/null`

\n<HR>

\n<A NAME=\"_query\">

\n`_item omnicc -query`

\n`$OMNIBIN/omnicc -query`

\n<HR>

\n<A NAME=\"_prevlast\">

\n`_item omnistat -prev -last 30`

\n`$OMNIBIN/omnistat -prev -last 30`

\n<HR>

\n<A NAME=\"_devinfo\">

\n`_item omnidownload -dev_info`

\n`$OMNIBIN/omnidownload -dev_info`

\n<HR>

\n<A NAME=\"_detail\">

\n`_item omnidownload -list_libraries -detail`

\n`$OMNIBIN/omnidownload -list_libraries -detail`

`_footer`" > $FILE4

if

[ -f /opt/omni/bin/omnib ]; then

echo "<A HREF=omni_ver_info.html>Version info</A>   " >> $OUT_DIR/index.html

echo "`_title OmniBack II version Information`

\n`_item Versioning...`

\n`$OMNIBIN/omniabort -ver`

\n`$OMNIBIN/omnib -ver`

\n`$OMNIBIN/omnicc -ver`

\n`$OMNIBIN/omnicellinfo -ver`

\n`$OMNIBIN/omniclus -ver`

\n`$OMNIBIN/omnicreatedl -ver`

\n`$OMNIBIN/omnidb -ver`

\n`$OMNIBIN/omnidbva -ver`

\n`$OMNIBIN/omnidownload -ver`

\n`$OMNIBIN/omnihealthcheck -ver`

\n`$OMNIBIN/omnimcopy -ver`

\n`$OMNIBIN/omniminit -ver`

\n`$OMNIBIN/omnimlist -ver`

\n`$OMNIBIN/omnimm -ver`

\n`$OMNIBIN/omnimnt -ver`

\n`$OMNIBIN/omnimver -ver`

\n`$OMNIBIN/omnir -ver`

\n`$OMNIBIN/omnirpt -ver`

\n`$OMNIBIN/omnistat -ver`

\n`$OMNIBIN/omniupload -ver`

`_footer`" > $FILE3

fi

if [ -f /opt/omni/sbin/utilns/get_info ]; then

echo "<A HREF=omni_get_info.html>get_info</A>   " >> $OUT_DIR/index.html

echo "`_title OmniBack II Configuration Info`

\n`_item get_info`

\n`/opt/omni/sbin/utilns/get_info`

`_footer`" > $OUT_DIR/omni_get_info.html

fi

if [ -f /etc/opt/omni/cell/cell_info ]; then

echo "<A HREF=omni_cell_info.html>Cell Info</A>   " >> $OUT_DIR/index.html

fi

if [ -f /opt/omni/sbin/omnidbutil ]; then

echo "<A HREF=omni_db_info.html>DataBase Info</A> " >> $OUT_DIR/index.html

echo "  \n</PRE>\n<HR>\n" >> $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<BR>" >> $FILE

else

MISSING_Y2K_PATCHES=TRUE

echo "<font color=$FCOL2>missing y2koscheck utility</FONT>">> $FILE

fi

if [ -f /usr/contrib/bin/y2kappcheck ]; then

echo "Application related Y2K Information: `_create_link /usr/contrib/bin/y2kappcheck`<BR>" >> $FILE

else

MISSING_Y2K_PATCHES=TRUE

echo "<font color=$FCOL2>missing y2appcheck utility</FONT>">> $FILE

fi

fi

if [ $MISSING_Y2K_PATCHES = "TRUE" ]; then

echo "<P><center><font color=$FCOL size=+1>WARNING!</font><P>

<font color=$FCOL2>y2koscheck</font> and / or

<font color=$FCOL2>y2kappcheck</font> utility not found!</center><P>\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.

<P>\nYou'll find this Patch (and others) @ the

<A HREF=\"http://us-support.external.hp.com\">

Americas and Asia-Pacific Electronic Support Center</A> or the

<A HREF=\"http://europe-support.external.hp.com\">

European Electronic Support Center</A>\n" >> $FILE

fi

echo "</PRE>\n<HR>\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 "<A HREF="x25.html">x25stat</A> " >> $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 "</PRE>\n</BODY></HTML>" >> $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}'`

<P><B><A HREF="nnm.conf">Config files</A>\t<A HREF="lrf.conf">Local Registration Files</A>\t<A HREF="ov.log">OV_LOG</A>\t<A HREF="ovpriv.log">OV_PRIV_LOG</A></B>

\n<A HREF="ovstatus.html">ovstatus</A>  <A HREF="ovmap.html">Map's</A>  <A HREF="ovtopo.html">topology</A>

\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</BODY></HTML>"

_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}'`

<P><B><A HREF="nnm.conf">Config files</A>\t<A HREF="lrf.conf">Local Registration Files</A>\t<A HREF="ov.log">OV_LOG</A>\t<A HREF="ovpriv.log">OV_PRIV_LOG</A></B>

\n<A HREF="ovstatus.html">ovstatus</A>  <A HREF="ovmap.html">Map's</A>  <A HREF="ovtopo.html">topology</A>

`_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</BODY></HTML>"

_ito_conf_files

}

function _itostatus {

echo "`_item OpenView ITO Status:`\n

<PRE>\n`_item opcsv -status`\n\n`$OV_BIN/OpC/opcsv -status`</PRE>

<PRE>\n`_item opcagt -status`\n\n`$OV_BIN/OpC/opcagt -status`</PRE>"

}

function _nnmindex {

_heading OpenView NNM

_item NNM Version:

_nnmversion

echo "<P><A HREF="nnm.html">NNM Information</A> "

}

function _itoindex {

_heading OpenView ITO

_item OpenView ITO Version:

_itoversion

echo "<P><A HREF="ito.html">OpenView ITO Information</A> "

}

function _licensing {

echo "   <A HREF="ifor.html">License</A> " >> \

$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.<P>

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.<P>

Contact your local Response Center for further details.<P><P>"

_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<PRE>

`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 "<P><A HREF="tmn.html">TMN Information</A>    

<A HREF="nnm.html">NNM Information</A> "

}

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, <B>why</B>?";

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 "<PRE>\n`_item xnmsnmpconf -opt`\n`xnmsnmpconf -opt`</PRE>"

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 "<PRE>\n`$OV_BIN/ovobjprint -S`\n</PRE>"

}

function _ovtopo {

echo "`_title Topology`\n<PRE>

\n`_item ovtopodump -l -v`\n\n`$OV_BIN/ovtopodump -l -v`\n

\n`_item xnmtopoconf -print`\n\n`$OV_BIN/xnmtopoconf -print`\n</PRE>\n"

}

function _mapinfo {

echo "`_title Map Information`\n<PRE>\n

`_item ovwls -a -G`\n`ovwls -a -G`\n

`_item ovmapdump -l -v`\n`ovmapdump -l -v`\n</PRE>\n"

}

### OV Telecom Stuff ###

function _tmn {

_title TMN Information

echo "`_item TMN Version:``_nnmversion`  <P>

<A HREF="lrf.conf">Local Registration Files</A>  

<A HREF="ov.log">Log files</A>

<A HREF="ovstatus.html">ovstatus</A>  

<A HREF="osiconfcheck.html">osiconfcheck -bd</A>  

<A HREF="ovsuf.html">ovsuf</A>  

<A HREF="odbc.html">odbc.ini</A>  

<A HREF="ovors.html">ovors</A><P>

`_cat_file $OV_CONF/local_p_addr`

`_item what pmd`\n<PRE>\n`what $OV_BIN/pmd`\n</PRE>

`_item ovconftest`\n<PRE>`ovconftest`

<P> \n</BODY></HTML>"

_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<PRE>\n`ovorsutil -s`\n</PRE>\n

`_item ovorsutil -h`\n<PRE>\n`ovorsutil -h`\n</PRE>\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, <A HREF="SNA/index.html">more Info</A> ">> $OUT_DIR/index.html

echo "`_title SNA`\n`what /stand/vmunix|grep -i sna`<P>

\n<A HREF="snapsysinfo.html">snapsysinfo</A><P>

\n<A HREF="snaerr.html">Error and Audit files collected</A><P>

\n<A HREF="snapconfig.html">snapconfig</A>\n" > $FILE

_snapsysinfo > $OUT_DIR/SNA/snapsysinfo.html

_snapconfig > $OUT_DIR/SNA/snapconfig.html

_snaerr > $OUT_DIR/SNA/snaerr.html

echo "\n\n</PRE>\n</BODY></HTML>" >> $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 "<P>`_item sna_domn.cfg`<P>"

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}'`, <A HREF="SG/index.html">more

Information</A> \n\n" >> $OUT_DIR/index.html

echo "`_title ServiceGuard`\n`what /stand/vmunix|grep -i service`<P>

\n<A HREF="sgnetstat.html">netstat information</A>    <A HREF="sgservices.html">SG Entries in /etc/services</A><P>

\n<b>cm commands</b>:<P>

\n<A HREF="cmviewcl.html">cmviewcl</A>    <A HREF="cmgetconf.html">cmgetconf</A>    <A HREF="cmscancl.html">cmscancl</A>\n\n\n<P>\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 "<B> `swlist | grep -i java | awk '{print $2}'`</B><BR>"

echo "<BR><BR><A HREF=environment.html>Environment variables</A><BR>"

}

##########################################

# Storage and Fibre Channel Information #

##########################################

function _fibre_channel {

if [ -f /opt/fcms/bin/fcmsutil ]; then

echo "\t\t * Fibre Channel"

_heading Fibre Channel >> $OUT_DIR/index.html

FILE=$OUT_DIR/fc.html

echo "<A HREF="fc.html">Information</A> \n\n<HR>" >> $OUT_DIR/index.html

echo "`_title Fibre Channel`

\n `_item Information about installed FC Adapters`

Kernel driver version:\n`$UBIN/what /stand/vmunix|grep fcms`\n<BR>" > $FILE

for i in /dev/fcms* /dev/td*

do

echo "\n<BR>\n<FONT COLOR=RED>fcmsutil $i </FONT>\n" >> $FILE

/opt/fcms/bin/fcmsutil $i >> $FILE

done

_footer >> $FILE

fi

}

##########################################

# #

# #

# OCMP Telecom Infrastructure Division #

# #

# #

##########################################

function _ocmpindex {

_heading OpenCall Media Platform

_item OpenCall Media Platform Version

echo "<BR>"

_ocmpversion

echo "<BR>

<PRE>

`ioscan -fn| grep Description`

`ioscan -fn| grep ===========`

`ioscan -fn| grep sonet`

</PRE>"

echo "<P><A HREF="ocmp.html">OpenCall Media Platform Information</A><BR> "

}

function _ocmpversion {

if [ -f $OOB/OCMedia ];

then

echo "<B>`swlist| grep -i netaction | awk '{print $2}'`</B>"

else

echo "<FONT Color=Red>OpenCall not installed with netaction depots</FONT>"

fi

}

function _ocmpsoft {

_title OpenCall Software Information

_item OpenCall Media Platform Version:

_ocmpversion

echo "<HR>"

_item OpenCall related Software installed:

swlist |grep -i OC | grep -v Patch |sort

echo "<HR>"

_item OpenCall related Patches installed:

swlist | grep -i OC | grep -i Patch |sort

_footer

}

function _ocmplist {

echo "<A NAME=\"_lind\">"

_title OCMP Directory listings

echo "<A HREF=\"#_loO\">/opt/OCMP</A><BR>"

echo "<A HREF=\"#_eoO\">/etc/opt/OCMP</A><BR>"

echo "<A HREF=\"#_voHP\">/var/opt/HP-AIN</A><BR><HR>"

echo "<A NAME=\"_loO\">"

_item /opt/OCMP/

ls -laR /opt/OCMP/

echo "<HR>"

echo "<A HREF=\"#_lind\">top</A><BR>"

echo "<A NAME=\"_eoO\">"

_item /etc/opt/OCMP/

ls -laR /etc/opt/OCMP/

echo "<HR>"

echo "<A HREF=\"#_lind\">top</A><BR>"

echo "<A NAME=\"_voHP\">"

_item /var/opt/HP-AIN/

ls -laR /var/opt/HP-AIN/

echo "<A HREF=\"#_lind\">top</A><BR>"

_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 "<A HREF=ocmpconf.html>OCMP Configuration</A><BR>"

echo "`_title OpenCall Software Configuration Information`" > $FILE

echo "

Initial configuration setup, Color, LPC, Default XML files.\n

<A HREF=ocmpsetup.html>Installation Configuration</A><BR>

OpenCall related software installed.\n

<A HREF=ocmpsoft.html>OC Software</A><BR>

User XML configuration and properties files\n

<A HREF=ocmpuser.html>User Defined Configuration</A><BR>

OCMP directory listings\n

<A HREF=ocmplist.html>Directory Listing</A><BR>

System /etc/services\n

<A HREF=services.html>/etc/services</A><BR>

Active internet connections \( netstat \) \n

<A HREF=netstat.html>netstat</A><BR>

Dynamically Loadable Kernel Module Status\n

<A HREF=kmadmin_-s.html>kmadmin -s</A><BR>

Platform trace and log files\n

<A HREF=ocmptrace.html>Logs and Trace files</A><BR>

Java Software\n

<A HREF=java.html>Java Software</A><BR>

Running Processes\n

<A HREF=ocmpproc.html>Running Processes</A><BR>

</BODY></HTML>"

>> $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 <BR>"

fi

_title2 Software Configuration

_item OCMP Installed Version:

echo "<BR>"

_ocmpversion

_ocmpconf

echo "<BR>"

_title2 Hardware

_item ioscan -fnC sonet

ioscan -fnC sonet

echo "<BR><P>"

_title2 tmcDiag

if [ -f $OOB/SonetSDHCardIsRunning ]; then

echo "<B>Note:<BR>SonetSDHCardIsRunning</B>"

echo "<B>Not executing tmcDiag</B><BR>"

else

echo "<B>Note: The SonetSDHCard NOT running<BR></B>"

echo "<B>It is safe to tmcDiag</B><BR>"

_item tmcDiag

for CARD in `ioscan -fnCsonet|grep -v "==="|grep -v dev|grep -v Driver|awk '{print $2}'`

do

echo "Sonet Card Instance: $CARD <BR>"

/opt/OCMP/bin/tmcDiag -M $CARD

echo "<HR>"

done

fi

echo "</P>"

_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 "<BR><B>/etc/opt/OCMP/</B><A HREF=ocmpproperties.html>OCMP.properties html format</A><BR>" >> $FILE1

echo "`_footer`" >> $FILE1

echo "`_title OpenCall User Configuration`

`_item XML Config`

<A HREF=OCMP>Platform configuration : /etc/opt/OCMP/</A>\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:<BR>

a\) nettl traces and logs<BR>

b\) traces and logs on the stdout<BR>"

cat /etc/opt/OCMP/initANSIIsupOCMedia.bsh | grep TracerConfig

elif [[ $ISUPCOLOR = "ITU" ]]; then

_title2 ITU ISUP Variant

echo "The following setting determines the following logging:<BR>

a\) nettl traces and logs<BR>

b\) traces and logs on the stdout<BR>"

_item Trace mode: initITUIsupOCMedia.bsh

cat /etc/opt/OCMP/initITUIsupOCMedia.bsh | grep TracerConfig

else

_item ISUP Color

echo "ERROR: Unrecognised ISUP Variant: $ISUPCOLOR<BR>"

fi

_title2 nettl traces

echo "<P><BR>"

echo "/var/opt/HP-AIN/ttl/<A HREF=ocmptrc.html>trace.TRC0</A></P>"

echo "<BR><P>"

echo "/var/adm/<A HREF=netfmt.html>nettl.LOG00</A></P>"

_title2 LOG.OCMP

echo "The stdout and stderr output redirections : <BR>"

if [ -f /tmp/LOG.OCMP.1 ]; then

_collect_file LOG.OCMP.1 /tmp/LOG.OCMP.1

else

echo "<B>NOTE:</B> File not Found: /tmp/LOG.OCMP.1<BR>"

fi

if [ -f /tmp/LOG.OCMP.2 ]; then

_collect_file LOG.OCMP.2 /tmp/LOG.OCMP.2

else

echo "<B>NOTE:</B> File not Found: /tmp/LOG.OCMP.2<BR>"

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/<BR>"

mkdir $OUT_DIR/OCMP/

fi

if [ -f $OUT_DIR/OCMP/OCMP.properties ]; then

echo ""

else

echo "Copying OCMP.properties to $OUT_DIR/OCMP/<BR>"

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 "<PRE>" >> $TMP

cat /etc/opt/OCMP/OCMP.properties >> $TMP

echo "</PRE>" >> $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="<A HREF=$VAL3>$VAL2</A>"

#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="<A HREF=OCMP/initITUIsupOCMedia.bsh>/etc/opt/OCMP/initITUIsupOCMedia.bsh</A>"

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 "<HTML><BODY><BR><B>ERROR:</B> File not Found: /etc/opt/OCMP/OCMP.properties<BR></BODY></HTML>" > $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 "<BR><B>NOTE:</B> File not Found: /var/opt/HP-AIN/ttl/trace.TRC0<BR>"

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 '^<!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

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'
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: