Sunteți pe pagina 1din 39

NBInfo.

sh
README
calc_space.sql cron-nbinfo
hitratio.sql
log
quecheck.awk
bash-3.2# more NBInfo.sh
#!/bin/sh
#
# $Id: NBInfo.sh,v 1.43 2007/08/24 15:12:22 shodler Exp $
#
REV=`echo '$Revision: 1.43 $' | awk '{print $2}'`
#
# Run NBInfo.sh -h for a useage breakdown.
#
#

frag_info.sql

PATH=/usr/bin:$PATH
PS()
{
/usr/bin/ps -ef | grep -v grep | grep $1
}
#
VP()
{
printf "Listing of all %s processes:\n" $USER >> $FILE
printf "\n" >> $FILE
printf " USER
PID PPID CPU MEM COMM\n" >> $FILE
/usr/bin/ps -efo user,pid,ppid,pcpu,pmem,comm | grep $USER | grep -v gr
ep | grep -v /bin/sh | grep -v "[- /bin/ck]sh"| grep -v telnet | grep -v xterm |
grep -v
"dt[termfilepadwmscreen ]" | grep -v more | sed -e 's/,//g' | /usr/bin/sort -r
+3 +4 >> $FILE
}
#
QUEUE()
{
printf "Queuerpc Check:\n" >> $FILE
printf "\n" >> $FILE
printf "vp found:
%s queuerpcs running\n"`PS queuerpc | wc -l` >>
$FILE
#
roccont -w | grep "^Queue" | wc -l | awk '{printf "roccont found: %s qu
euerpcs running\n", $1}' >> $FILE
printf "\n" >> $FILE
#
printf "Output comparison of roccont to vp for queuerpcs:\n" >> $FILE
printf "\n" >> $FILE
#
roccont -w | grep pid | sed -e 's/,//g' | awk '{printf ("%d\n"), $10}' |
sort -n > /tmp/roc
/usr/ucb/ps -auwx |grep -v grep |grep queuerpc |awk '{printf "%13s\n", $
2}' |sort -n > /tmp/vp
printf "Roccont PID:
VP PID:\n" > /tmp/alert
printf "------------------\n" >> /tmp/alert
--More--(6%)
paste /tmp/roc /tmp/vp >> /tmp/alert
cat /tmp/alert >> $FILE
}
#
PPID()
{
printf "\n" >> $FILE
printf "Queuerpc to Parent Process table:\n" >> $FILE

printf "\n" >> $FILE


/usr/bin/ps -efo user,pid,ppid,comm | awk -f $HDIR/quecheck.awk >> $FILE
rm /tmp/ver /tmp/roc /tmp/vp /tmp/alert
}
#
SYSINFO()
{
printf "Host Information:\n" >> $FILE
printf "\n" >> $FILE
echo "Hostname
= "$HOST >> $FILE
echo "IP Address
= "`arp $HOST | sed -e 's;(;;' -e 's;);;'| aw
k '{print $2}'` >> $FILE
echo "HostId
= "`hostid` >> $FILE
echo "Ethernet Address
= "`arp $HOST | awk '{print $4}'` >> $FILE
echo "OS
= "`uname -s -r` >> $FILE
echo "H/W Architecture
= "`uname -m -i` >> $FILE
echo "Kernel Patch Level = "`uname -v` >> $FILE
echo "OBP Version
= "`prtconf -V | grep OBP | awk '{print $2}
'` >> $FILE
echo "Num of Processors
="`psrinfo | wc -l` >> $FILE
echo "Processor(s) speed = "`psrinfo -v | awk '/processor operates at/
{print $6, $7}' | sed -e 's/,//g'` >> $FILE
#echo "Processor(s) speed = "`dmesg | awk 'BEGIN { FS = "(" } /cpu0/ {
print $2}' | sed -e 's/)//g' | awk '{print $8, $9}' | head -1` >> $FILE
echo "Memory
= "`prtconf | awk '/Memory size/ {print $3, $
4}'` >> $FILE
echo "Last System Reboot = "`who -b | awk '{print $4, $5, $6}'` >> $FI
LE
}
#
USERINFO()
{
printf "Current User Info:" >> $FILE
printf "\n" >> $FILE
printf "\n" >> $FILE
id -a | sed -e 's;=;= ;g' -e 's;(; ;g' -e 's;); ;g' | while read a b c
d e f g h i ; do
printf "User Name
= %s\n" $c >> $FILE
printf "User ID
= %s\n" $b >> $FILE
printf "Primary Group Name = %s\n" $f >> $FILE
printf "Primary Group ID
= %s\n" $e >> $FILE
--More--(14%)
done
#
printf "Home Directory
= %s\n" $HOME >> $FILE
printf "Current Shell
= %s\n" $SHELL >> $FILE
printf "DISPLAY
= %s\n" $DISPLAY >> $FILE
printf "Terminal Address
= %s\n" `tty` >> $FILE
echo "ManageIT Version
= "$HNMV >> $FILE
echo "ANMDIR Path
= "$ANMDIR >> $FILE
PSMODE="`grep -i psmode $ANMDIR/config/parse.cfg | awk '{print $3}'`"
if [ "$PSMODE" = "0" ] ; then
printf "PsMode
= %s (correct)\n" $PSMODE >> $FILE
else
printf "PsMode
= %s (should be set to 0)\n" $PSMOD
E >> $FILE
fi
echo "SLGMS Version
= "$SLGMS_VER >> $FILE
echo "Database
= "$DB >> $FILE
echo "DB Version
= "$VER >> $FILE
echo "DB Path
= "$DBPATH >> $FILE

if [ "$DB" = "ORACLE" ] || [ "$DB" = "Oracle" ] || [ "$DB" = "oracle" ]


; then
echo "Oracle SID
= "$SID >> $FILE
fi
if [ -f '/tmp/masterscript_mode' ] ; then
printf "System Status:
= %s\n" `cat /tmp/master_script_mod
e` >> $FILE
else
printf "System Status:
= Undefined\n" >> $FILE
fi
if [ -f `/usr/bin/which perl` ] ; then
printf "Path to Perl:
= %s\n" `/usr/bin/which perl` >> $F
ILE
else
printf "Path to Perl:
= Not Found\n" >> $FILE
fi
if [ -d /opt/OV ] ; then
printf "SNMP Manager Version = %s\n" `/opt/OV/bin/ovversion` >>
$FILE
fi
if [ -d /opt/tarantella ] ; then
if [ -f "/opt/tarantella/info/version.out" ] ; then
TTAVER=`basename "\`head -1 /opt/tarantella/info/version
.out | \
sed -e 's;^;/;' -e 's; ;/;g' -e 's/(//' -e 's/)/
/'\`"`
printf "Tarantella Version: = %s\n" $TTAVER >> $FILE
else
echo "Please check README for notes on crontab setup for
root user."
fi
--More--(23%)
fi
printf "\n" >> $FILE
printf "PATH
= %s\n" $PATH >> $FILE
printf "\n" >> $FILE
printf "LD_LIBRARY_PATH
= %s\n" $LD_LIBRARY_PATH >> $FILE
}
#
KERNEL()
{
case `uname -r` in
5.8|5.9)
# Checks the /etc/system file settings
# NS = New Setting CS = Current Setting PNS = Partial
NS PCS = Partial CS
#
printf "Compare kernel configuration settings:\n" >> $FI
LE
printf "\n" >> $FILE
for NS in maxusers\=256 shminfo_shmseg\=600 shminfo_shmm
ni\=512 shminfo_shmmin\=1 seminfo_semmns\=4096 seminfo_semmni\=4096 seminfo_semm
nu\=4096
seminfo_semume\=85 seminfo_semmap\=512 seminfo_semmsl\=150 seminfo_semopm\=150
seminfo_semvmx\=32767 ; do
PNS=`echo $NS | sed -e 's;=; ;' | awk '{print $1
}'`
CS=`sed -n "/^set.*:*$PNS/s;set.*:*$PNS;$PNS;p"
/etc/system`
if echo $CS | grep $NS 2>&1 > /dev/null ; then
printf "%-25s
OK\n" $CS >> $FILE

else
if [ "$CS" = "" ] ; then
printf "%-25s
is not set.
Should be set to: %-25s\n" $PNS $NS >> $FILE
else
printf "%-25s
should be
%-25s\n" $CS $NS >> $FILE
fi
fi
done
#
MEM=`prtconf | awk '/Memory size/ {print $3}'`
printf "%s * .80\n" $MEM > $HDIR/bc.cmd
PMEM=`bc<$HDIR/bc.cmd`
#
printf "%.2f * 1048576\n" $PMEM > $HDIR/bc.cmd
VALUE=`bc<$HDIR/bc.cmd`
/bin/rm $HDIR/bc.cmd
NS=`printf "shminfo_shmmax=%.0f\n" $VALUE`
#
PNS=shminfo_shmmax
CS=`sed -n "/^set.*:*$PNS/s;set.*:*$PNS;$PNS;p" /etc/sys
tem`
--More--(30%)
#
if [ "$CS" -ge "$NS" ] ; then
printf "%-25s
OK\n" $CS >> $FILE
else
if [ "$CS" = "" ] ; then
printf "%-25s is not set. Should be set
to: %-25s\n" $PNS $NS >> $FILE
else
printf "%-25s
should be
%-25s\n"
$CS $NS >> $FILE
fi
fi
;;
5.10)
# Checks the /etc/system file settings
# NS = New Setting CS = Current Setting PNS = Partial
NS PCS = Partial CS
#
printf "Compare kernel configuration settings:\n" >> $FI
LE
printf "\n" >> $FILE
for NS in maxusers\=256 seminfo_semmni=4096 seminfo_semm
sl=256 seminfo_semopm=150 ; do
PNS=`echo $NS | sed -e 's;=; ;' | awk '{print $1
}'`
CS=`sed -n "/^set.*:*$PNS/s;set.*:*$PNS;$PNS;p"
/etc/system`
if echo $CS | grep $NS 2>&1 > /dev/null ; then
printf "%-25s
OK\n" $CS >> $FILE
else
if [ "$CS" = "" ] ; then
printf "%-25s
is not set.
Should be set to: %-25s\n" $PNS $NS >> $FILE
else
printf "%-25s
should be

%-25s\n" $CS $NS >> $FILE


fi
fi
done
printf "\n" >> $FILE
printf "Checking oracle setting requirements in /etc/use
r_attr:\n" >> $FILE
printf "\n" >> $FILE
USERATTR='oracle::::project=group.dba'

--More--(37%)

CATUSERATTR="`grep group.dba /etc/user_attr`"


if [ $? -eq "1" ] ; then
CATUSERATTR=empty
fi
if echo $USERATTR | grep $CATUSERATTR 2>&1 > /dev/null ;

then
printf "%-28s OK\n" $CATUSERATTR >> $FILE
else
if [ $CATUSERATTR = "empty" ] ; then
printf "%-25s
is not set.
e set to: %-25s\n" group.dba $USERATTR >> $FILE
else
printf "%-25s
should be
group.dba $USERATTR >> $FILE
fi
fi

Should b
%-25s\n"

printf "\n" >> $FILE


printf "Checking oracle setting requirements in /etc/pro
ject:\n" >> $FILE
printf "\n" >> $FILE
PROJECT='group.dba:102:Oracle:oracle:dba:project.max-sem
-ids=(privileged,128,deny);process.max-sem-nsems=(privileged,512,deny);project.m
ax-shm-i
ds=(privileged,128,deny);project.max-shm-memory=(privileged,1073741824,deny)'
CATPROJECT="`grep group.dba /etc/project`"
if [ $? -eq "1" ] ; then
CATPROJECT=empty
fi
if echo $PROJECT | grep $CATPROJECT 2>&1 > /dev/null ; t
hen
printf "%-25s

OK\n" $CATPROJECT >> $FILE

else
if [ $CATPROJECT = "empty" ] ; then
printf "%-25s
is not set.

Should b

e set to:\n" group.dba >> $FILE


printf "%-25s\n" $PROJECT >> $FILE
else
printf "%-25s

should be\n" group.dba

>> $FILE
printf "%-25s\n" $PROJECT >> $FILE
fi
fi

;;
esac
}
#
DBINFO()
{
--More--(43%)
printf "Check DB Space:\n" >> $FILE
#
if [ "$DB" = "INFORMIX" ] ; then
$INFORMIXDIR/bin/onstat -d >> $FILE
else
# Try to determine correct DB login info:
# Manaully set username and password here (remember to uncomment
):
#ORAUSER=
#ORAPASSWD=
if [ ! -z "$ORAUSER" ] && [ ! -z "$ORAPASSWD" ] ; then
$ORACLE_HOME/bin/sqlplus ${ORAUSER}/${ORAPASSWD} << EOT 1>/var/tmp/otherdb
EOT
test -z "`grep \"invalid username\" /var/tmp/otherdb`" &
& DBADMIN="${ORAUSER}/${ORAPASSWD}"
else
$ORACLE_HOME/bin/sqlplus netboss/netboss << EON 1>/var/tmp/netbossdb
EON
$ORACLE_HOME/bin/sqlplus hnmadm/hnmadm << EOA 1>/var/tmp/hnmadmdb
EOA
test -z "`grep \"invalid username\" /var/tmp/netbossdb`"
&& DBADMIN="netboss/netboss"
test -z "`grep \"invalid username\" /var/tmp/hnmadmdb`"
&& DBADMIN="hnmadm/hnmadm"
fi
if [ -z "$DBADMIN" ] ; then
echo " " >> $FILE
echo "Sorry. Incorrect DB Login." >> $FILE
echo "Please edit NBInfo.sh lines and manually set ORAUS
ER and ORAPASSWD" >> $FILE
echo "under DBINFO() function." >> $FILE
else
$ORACLE_HOME/bin/sqlplus -s netboss/netboss @$HDIR/calc_space.sql<<EOC | sed -e
'/rows selected/d' >> $FILE
quit
EOC
$ORACLE_HOME/bin/sqlplus -s netboss/netboss @$HDIR/hitratio.sql<<EOH >> $FILE
quit
EOH
$ORACLE_HOME/bin/sqlplus -s netboss/netboss @$HDIR/frag_info.sql<<EOF >> $FILE
quit
--More--(49%)
EOF
fi
fi
# Cleanup temp files in /var/tmp:

for TFILE in netbossdb hnmadmdb ; do


[ -f /var/tmp/${TFILE} ] && /bin/rm /var/tmp/${TFILE}
done
#
}
#
STATS()
{
printf "MPSTAT:\n" >> $FILE
printf "\n" >> $FILE
mpstat 3 5 >> $FILE
printf "\n" >> $FILE
printf "---------------------------------------------------------------------------\n" >> $FILE
printf "\n" >> $FILE
printf "IOSTAT:\n" >> $FILE
printf "\n" >> $FILE
iostat 3 5 >> $FILE
printf "\n" >> $FILE
printf "---------------------------------------------------------------------------\n" >> $FILE
printf "\n" >> $FILE
printf "VMSTAT:\n" >> $FILE
printf "\n" >> $FILE
vmstat 3 5 >> $FILE
}
#
CRON()
{
if [ -f /var/spool/cron/crontabs/$USER ] ; then
printf "NetBoss' crontab:\n" >> $FILE
printf "\n" >> $FILE
crontab -l >> $FILE
else
printf "NetBoss does not have a crontab\n" >> $FILE
fi
}
#
DF()
--More--(54%)
{
printf "Disk Space Check:\n" >> $FILE
printf "\n" >> $FILE
df -kF ufs | grep -v cdrom >> $FILE
}
#
SWAP()
{
printf "Summary of Swap:\n" >> $FILE
printf "\n" >> $FILE
swap -s >> $FILE
}
#
IPCS()
{
printf "Active Inter-process Communication Facilities Status Report:\n"
>> $FILE
printf "\n" >> $FILE
ipcs -cp >> $FILE
}
#

TABS()
{
printf "Contents of /etc/vfstab:\n" >> $FILE
printf "\n" >> $FILE
more /etc/vfstab | /usr/bin/egrep -v "#/|fd|proc|swap" >> $FILE
printf "\n" >> $FILE
#
printf "---------------------------------------------------------------------------\n" >> $FILE
printf "\n" >> $FILE
printf "Contents of /etc/dfs/dfstab:\n" >> $FILE
more /etc/dfs/dfstab | /usr/bin/grep -v "^#" >> $FILE
}
#
LUX()
{
/usr/sbin/luxadm display FCloop 1>&2 2>/dev/null
[ "$?" = "0" ] && FCLOOP=true || FCLOOP=false
if [ "$FCLOOP" = "true" ] ; then
/usr/sbin/luxadm display FCloop | grep SSC100 1>&2 2>/dev/null
[ "$?" = "0" ] && SSC100=true || SSC100=false
--More--(59%)
fi
if [ "$SSC100" = "true" ] ; then
printf "Output of luxadm display FCloop | grep SSC100:\n" >> $FI
LE
printf "\n" >> $FILE
/usr/sbin/luxadm display FCloop | grep SSC100 >> $FILE
fi
}
#
WHODO()
{
printf "Statistics for current users\n" >> $FILE
printf "\n" >> $FILE
whodo -l >> $FILE
}
#
SGACHECK()
{
# Snapshot the Elements directories for tracking what versions of the SM
As are on the system.
printf "Snapshot of $ANMDIR/sga/Elements directory:\n" >> $FILE
printf "\n" >> $FILE
/usr/bin/ls -l $ANMDIR/sga/Elements | grep -v "^total" >> $FILE
}
#
TTAINFO()
{
# Checking tarantella license information
if [ -f "/opt/tarantella/info/license-query.out" ] ; then
printf "Output from tarantella license query:\n" >> $FILE
cat /opt/tarantella/info/license-query.out >> $FILE
fi
printf "\n" >> $FILE
if [ -f "/opt/tarantella/info/license-list.out" ] ; then
printf "Output from tarantella license list:\n" >> $FILE

cat /opt/tarantella/info/license-list.out >> $FILE


fi
}
#
META()
{
--More--(63%)
if [ -f /usr/sbin/metastat ] ; then
metastat 1>/dev/null 2>/dev/null
if [ $? -eq "0" ] ; then
printf "---------------------------------------------------------------------------\n" >> $FILE
printf "Status of metadevice(s) or hot spare pool:\n" >>
$FILE
metastat >> $FILE
printf "\n" >> $FILE
printf "---------------------------------------------------------------------------\n" >> $FILE
printf "\n" >> $FILE
printf "---------------------------------------------------------------------------\n" >> $FILE
printf "Listing of boot devices:\n" >> $FILE
ls -l /dev/dsk/*s0 >> $FILE
printf "\n" >> $FILE
printf "---------------------------------------------------------------------------\n" >> $FILE
printf "\n" >> $FILE
fi
fi
}
#
if [ -f /usr/local/bin/setnetbossenv ] ; then
NBVER=PRE4.1
SETNETBOSSENV=/usr/local/bin/setnetbossenv
elif [ -f "${ANMDIR}/config/setnetbossenv" ] ; then
NBVER=POST4.1
SETNETBOSSENV=${ANMDIR}/config/setnetbossenv
else
echo "Not able to determine location of setnetbossenv file."
echo "Exiting." && exit 4
fi
#
ANMDIR=`grep "setenv ANMDIR " $SETNETBOSSENV | awk '{print $3}'`
$ANMDIR/bin/fms -ver 2>/tmp/ver
HNMV=`/usr/bin/cat /tmp/ver | fgrep "Manage.IT version"`
SLGMS_VER=`grep Release $GMS_HOME/* | head -1 | sed -e 's/^\/[A-Za-z0-9].*:# Con
figuration File for SL-GMS //'`
HDIR=$ANMDIR/NBInfo
HOST=`/usr/bin/hostname`
ROC=`/usr/bin/du -sk $ANMDIR/bin/roc | awk '{print $1}'`
USER=`/usr/bin/logname`
#
if [ "$INFORMIXDIR" != "" ] ; then
DB=INFORMIX
--More--(70%)
DBPATH=`echo $INFORMIXDIR`
VER=`$INFORMIXDIR/bin/dbaccess -V | head -1`
INFORMIXDIR=`grep "setenv INFORMIXDIR" $SETNETBOSSENV | awk '{print $3}'
`
if [ "a${INFORMIXDIR}" = "a" ] ; then
echo "Unable to find INFORMIXDIR setting. Unsupported system con

figuration."
echo "Exiting."
exit 4
fi
else
DB=ORACLE
DBPATH=`echo $ORACLE_HOME`
VER=`$ORACLE_HOME/bin/sqlplus "-?" | grep "Release"`
SID=`echo $ORACLE_SID`
if [ -f /usr/local/bin/dbhome ] ; then
ORACLE_HOME=`/usr/local/bin/dbhome`
else
echo "Unable to find ORACLE_HOME setting. Unsupported system con
figuration."
echo "Exiting."
exit 5
fi
fi
#
# This will clean up any residual from the last install or update:
if [ -f $HDIR/cleanup ] ; then
/bin/sh $HDIR/cleanup
rm $HDIR/cleanup
fi
#
test -t 1 && clear
case $1 in
-ver|-v)
printf "\n"
printf "NBInfo.sh Revision Number:
%s\n" $REV
printf "\n"
;;
-s)
printf "\n"
SYSINFO
printf "\n"
;;
#
-u)
printf "\n"
--More--(75%)
USERINFO
printf "\n"
;;
#
-q)
printf "Please Wait. Gathering System Information...\n"
#---------------------------------------------------------------------------------------------------------#
FILE=$HDIR/log/Quecheck.`date +%m-%d-%y.%H:%M:%S`
#
printf "\n" > $FILE
QUEUE
#
PPID
#
printf "\n" >> $FILE
roccont -s >> $FILE
printf "\n" >> $FILE
more $FILE

;;
#---------------------------------------------------------------------------------------------------------------debug)
# This is an undocumented feature used for debugging procedure updates/issues.
META
;;
#---------------------------------------------------------------------------------------------------------------B)
printf "Please Wait. Gathering System Information...\n"
#
FILE=$HDIR/log/Baseline.`date +%m-%d-%y.%H:%M:%S`
#
SYSINFO
printf "\n" >> $FILE
printf "---------------------------------------------------------------------------\n" >> $FILE
printf "\n" >> $FILE
USERINFO
printf "\n" >> $FILE
printf "---------------------------------------------------------------------------\n" >> $FILE
printf "\n" >> $FILE
DF
#
--More--(80%)
printf "\n" >> $FILE
printf "---------------------------------------------------------------------------\n" >> $FILE
printf "\n" >> $FILE
DBINFO
#
printf "\n" >> $FILE
printf "---------------------------------------------------------------------------\n" >> $FILE
printf "\n" >> $FILE
KERNEL
printf "\n" >> $FILE
printf "---------------------------------------------------------------------------\n" >> $FILE
printf "\n" >> $FILE
CRON
printf "\n" >> $FILE
printf "---------------------------------------------------------------------------\n" >> $FILE
printf "\n" >> $FILE
STATS
printf "\n" >> $FILE
printf "---------------------------------------------------------------------------\n" >> $FILE
printf "\n" >> $FILE
#
TABS
printf "\n" >> $FILE
printf "---------------------------------------------------------------------------\n" >> $FILE
printf "\n" >> $FILE
#
META

#
SWAP
printf "\n" >> $FILE
#
printf "---------------------------------------------------------------------------\n" >> $FILE
printf "\n" >> $FILE
#
IPCS
printf "\n" >> $FILE
#
printf "---------------------------------------------------------------------------\n" >> $FILE
printf "\n" >> $FILE
#
TTAINFO
printf "\n" >> $FILE
--More--(85%)
#
printf "---------------------------------------------------------------------------\n" >> $FILE
printf "\n" >> $FILE
#
LUX
printf "\n" >> $FILE
#
printf "---------------------------------------------------------------------------\n" >> $FILE
printf "\n" >> $FILE
#
SGACHECK
printf "\n" >> $FILE
#
more $FILE
;;
#
#---------------------------------------------------------------------------------------------------------------help|-h|-*)
cat << EOH
NBInfo.sh [-s] [-q] [-u] [-B] [-[v]er] [-[h]elp]
No Flag Gathers
-B
-s
-q
check.)
-u
-v or -ver
-h or -help

ALL Information (Log file name begins with NBInfo.)


Retrieve System Baseline (Log file name begins with Baseline.)
Display System Architecture (Does not get logged)
Only gather queuerpc information (Log file name begins with Que
User Environment Information (Does not get logged)
NBInfo.sh Revision Number (Does not get logged)
NBInfo.sh usage information

EOH
;;
#--------------------------------------------------------------------------------------------------------------*)
printf "Please Wait. Gathering System Information...\n"
#
FILE=$HDIR/log/NBInfo.`date +%m-%d-%y.%H:%M:%S`
#

printf "\n" > $FILE


SYSINFO
printf "\n" >> $FILE
printf "-------------------------------------------------------------------------More--(91%)
----\n" >> $FILE
printf "\n" >> $FILE
USERINFO
printf "\n" >> $FILE
printf "---------------------------------------------------------------------------\n" >> $FILE
printf "\n" >> $FILE
DF
#
printf "\n" >> $FILE
printf "---------------------------------------------------------------------------\n" >> $FILE
printf "\n" >> $FILE
#
SWAP
printf "\n" >> $FILE
#
printf "---------------------------------------------------------------------------\n" >> $FILE
printf "\n" >> $FILE
#
IPCS
printf "\n" >> $FILE
#
printf "---------------------------------------------------------------------------\n" >> $FILE
printf "\n" >> $FILE
DBINFO
#
printf "\n" >> $FILE
printf "---------------------------------------------------------------------------\n" >> $FILE
printf "\n" >> $FILE
KERNEL
printf "\n" >> $FILE
printf "---------------------------------------------------------------------------\n" >> $FILE
printf "\n" >> $FILE
CRON
printf "\n" >> $FILE
printf "---------------------------------------------------------------------------\n" >> $FILE
printf "\n" >> $FILE
TTAINFO
printf "\n" >> $FILE
printf "---------------------------------------------------------------------------\n" >> $FILE
printf "\n" >> $FILE
STATS
printf "\n" >> $FILE
printf "-------------------------------------------------------------------------More--(97%)
----\n" >> $FILE
printf "\n" >> $FILE
VP
printf "---------------------------------------------------------------------------\n" >> $FILE

printf "\n" >> $FILE


SGACHECK
printf "\n" >> $FILE
printf "---------------------------------------------------------------------------\n" >> $FILE
printf "\n" >> $FILE
WHODO
printf "\n" >> $FILE
#
more $FILE
;;
#
esac
bash-3.2#
bash-3.2#
bash-3.2#
bash-3.2#
bash-3.2# /u01/app/netboss/NBInfo/NBInfo.sh
morecdNBInfo.sh
ls
/u01/app/netboss/NBInfo/
Not able to determine location of setnetbossenv file.
Exiting.
bash-3.2# pwd
/u01/app/netboss/NBInfo
bash-3.2# cd
bash-3.2# pwd
/
bash-3.2# cd /app/net
app opt/home/netboss/
bash-3.2# /u01/app/netboss/NBInfo/NBInfo.sh
Not able to determine location of setnetbossenv file.
Exiting.
bash-3.2# ls
cd -lrt
pwdcd
more
/u01/app/netboss/NBInfo/NBInfo.sh
opt/home/netboss/
more
cd
NBInfo.sh
pwd/u01/app/netboss/NBInfo/NBInfo.sh
/u01/app/netboss/NBInfo/
NBInfo.sh
s*
-rw-r--r-- 1 netboss netboss 787766 Jun 14 10:19 sqlnet.log
smoke_test:
total 164
-rw-r--r-- 1 netboss netboss
48125 Dec 14 2012 result.test_netboss
-rw-r--r-- 1 root
other
35250 Jan 24 16:10 test_netboss
bash-3.2# cd /u01/app// ner tboss/
bash-3.2# config/
bash: config/: is a directory
bash-3.2# cd config/
bash-3.2# ls
cd -lrt
config/onfig/d
s*
/u01/app/netboss/
-rw-r--r-- 1 netboss netboss
4415 Oct 3 2007 setnetbossenv
-rw-rw-r-- 1 netboss netboss
2420 Dec 13 2012 sb.cfg
-rw-rw-r-- 1 netboss netboss
803 Dec 13 2012 security.cfg
-rw-rw-r-- 1 netboss netboss
2919 Dec 13 2012 send2roc.cfg
-rw-rw-r-- 1 netboss netboss
3940 Dec 13 2012 snmpcycld.cfg
-rw-rw-r-- 1 netboss netboss
2443 Dec 13 2012 snmpman.cfg
-rw-rw-r-- 1 netboss netboss
3607 Dec 13 2012 snmptrapd.cfg
-rw-rw-r-- 1 netboss netboss
1786 Dec 13 2012 ss.cfg
-rw-rw-r-- 1 netboss netboss
3514 Dec 13 2012 setnetbossenv.pre4.5.bak
bash-3.2# /u01/app/netboss/NBInfo/NBInfo.sh
Not able to determine location of setnetbossenv file.
Exiting.
bash-3.2# chmod +x
usage: chmod [-fR] <absolute-mode> file ...
chmod [-fR] <ACL-operation> file ...
chmod [-fR] <symbolic-mode-list> file ...
where <symbolic-mode-list> is a comma-separated list of
[ugoa]{+|-|=}[rwxXlstugo]
where <ACL-operation> is one of the following

A-<acl_specification>
A[number]A[number]{+|=}<acl_specification>
where <acl-specification> is a comma-separated list of ACEs
bash-3.2# pwd
/u01/app/netboss/config
bash-3.2# chmod +x setnetbossenv
bash-3.2# chown netboss:netboss setnetbossenv
bash-3.2# chmod 777 sen setnetbossenv
bash-3.2# ls -lrt s*
-rwxrwxrwx 1 netboss netboss
4415 Oct 3 2007 setnetbossenv
-rw-rw-r-- 1 netboss netboss
2420 Dec 13 2012 sb.cfg
-rw-rw-r-- 1 netboss netboss
803 Dec 13 2012 security.cfg
-rw-rw-r-- 1 netboss netboss
2919 Dec 13 2012 send2roc.cfg
-rw-rw-r-- 1 netboss netboss
3940 Dec 13 2012 snmpcycld.cfg
-rw-rw-r-- 1 netboss netboss
2443 Dec 13 2012 snmpman.cfg
-rw-rw-r-- 1 netboss netboss
3607 Dec 13 2012 snmptrapd.cfg
-rw-rw-r-- 1 netboss netboss
1786 Dec 13 2012 ss.cfg
-rw-rw-r-- 1 netboss netboss
3514 Dec 13 2012 setnetbossenv.pre4.5.bak
bash-3.2# ls -lrt s*
-rwxrwxrwx 1 netboss netboss
4415 Oct 3 2007 setnetbossenv
-rw-rw-r-- 1 netboss netboss
2420 Dec 13 2012 sb.cfg
-rw-rw-r-- 1 netboss netboss
803 Dec 13 2012 security.cfg
-rw-rw-r-- 1 netboss netboss
2919 Dec 13 2012 send2roc.cfg
-rw-rw-r-- 1 netboss netboss
3940 Dec 13 2012 snmpcycld.cfg
-rw-rw-r-- 1 netboss netboss
2443 Dec 13 2012 snmpman.cfg
-rw-rw-r-- 1 netboss netboss
3607 Dec 13 2012 snmptrapd.cfg
-rw-rw-r-- 1 netboss netboss
1786 Dec 13 2012 ss.cfg
-rw-rw-r-- 1 netboss netboss
3514 Dec 13 2012 setnetbossenv.pre4.5.bak
bash-3.2# /u01/app/netboss/NBInfo/NBInfo.sh
Not able to determine location of setnetbossenv file.
Exiting.
bash-3.2# vi /u01/app/netboss/NBInfo/NBInfo.sh
"/u01/app/netboss/NBInfo/NBInfo.sh" 685 lines, 21501 characters #!/bin/sh
#
# $Id: NBInfo.sh,v 1.43 2007/08/24 15:12:22 shodler Exp $
#
REV=`echo '$Revision: 1.43 $' | awk '{print $2}'`
#
# Run NBInfo.sh -h for a useage breakdown.
#
#
PATH=/usr/bin:$PATH
PS()
{
/usr/bin/ps -ef | grep -v grep | grep $1
}
#
VP()
{
printf "Listing of all %s processes:\n" $USER >> $FILE
printf "\n" >> $FILE
printf " USER
PID PPID CPU MEM COMM\n" >> $FILE
/usr/bin/ps -efo user,pid,ppid,pcpu,pmem,comm | grep $USER | grep -v grep | gre
p -v /bin/sh | grep -v "[- /bin/ck]sh"| grep -v telnet | grep -v xterm | grep -v
"dt[termfilepadwmscreen ]" | grep -v more | sed -e 's/,//g' | /usr/bin/sort -r
+3 +4 >> $FILE
}

#
QUEUE()
{
printf "Queuerpc Check:\n" >> $FILE
printf "\n" >> $FILE
printf "vp found:%s queuerpcs running\n"`PS queuerpc | wc -l` >> $FILE
#
roccont -w | grep "^Queue" | wc -l | awk '{printf "roccont found: %s queuerpcs
running\n", $1}' >> $FILE
printf "\n" >> $FILE
#
printf "Output comparison of roccont to vp for queuerpcs:\n" >> $FILE
printf "\n" >> $FILE
#
roccont -w | grep pid | sed -e 's/,//g' | awk '{printf ("%d\n"), $10}' | sort -n
> /tmp/roc
/usr/ucb/ps -auwx |grep -v grep |grep queuerpc |awk '{printf "%13s\n", $2}' |sor
t -n > /tmp/vp
printf "Roccont PID:
VP PID:\n" > /tmp/alert
printf "------------------\n" >> /tmp/alert
paste /tmp/roc /tmp/vp >> /tmp/alert"/u01/app/netboss/NBInfo/NBInfo.sh" 685 line
s, 21501 characters

cat /tmp/alert >> $FILE


}
#
PPID()
{
printf "\n" >> $FILE
printf "Queuerpc to Parent Process table:\n" >> $FILE
printf "\n" >> $FILE
/usr/bin/ps -efo user,pid,ppid,comm | awk -f $HDIR/quecheck.awk >> $FILE
rm /tmp/ver /tmp/roc /tmp/vp /tmp/alert
}
#
SYSINFO()
{
printf "Host Information:\n" >> $FILE
printf "\n" >> $FILE
echo "Hostname= "$HOST >> $FILE
echo "IP Address= "`arp $HOST | sed -e 's;(;;' -e 's;);;'| awk '{print $2}'` >>
$FILE
echo "HostId= "`hostid` >> $FILE
echo "Ethernet Address

= "`arp $HOST | awk '{print $4}'` >> $FILE

echo "OS= "`uname -s -r` >> $FILE


echo "H/W Architecture

= "`uname -m -i` >> $FILE

echo "Kernel Patch Level

= "`uname -v` >> $FILE

echo "OBP Version= "`prtconf -V | grep OBP | awk '{print $2}'` >> $FILE
echo "Num of Processors

="`psrinfo | wc -l` >> $FILE

echo "Processor(s) speed = "`psrinfo -v | awk '/processor operates at/ {print


$6, $7}' | sed -e 's/,//g'` >> $FILE
#echo "Processor(s) speed

= "`dmesg | awk 'BEGIN { FS = "(" } /cpu0/ {print $

2}' | sed -e 's/)//g' | awk '{print $8, $9}' | head -1` >> $FILE
echo "Memory= "`prtconf | awk '/Memory size/ {print $3, $4}'` >> $FILE
echo "Last System Reboot

= "`who -b | awk '{print $4, $5, $6}'` >> $FILE

}
#
USERINFO()
{
printf "Current User Info:" >> $FILE
printf "\n" >> $FILE
printf "\n" >> $FILE
id -a | sed -e 's;=;= ;g' -e 's;(; ;g' -e 's;); ;g' | while read a b c d e f g
h i ; do
printf "User Name= %s\n" $c >> $FILE
printf "User ID= %s\n" $b >> $FILE
printf "Primary Group Name

= %s\n" $f >> $FILE

printf "Primary Group ID

= %s\n" $e >> $FILE

done
#
printf "Home Directory= %s\n" $HOME >> $FILE
printf "Current Shell= %s\n" $SHELL >> $FILE
printf "DISPLAY= %s\n" $DISPLAY >> $FILE
printf "Terminal Address
echo "ManageIT Version

= %s\n" `tty` >> $FILE


= "$HNMV >> $FILE

echo "ANMDIR Path= "$ANMDIR >> $FILE


PSMODE="`grep -i psmode $ANMDIR/config/parse.cfg | awk '{print $3}'`"
if [ "$PSMODE" = "0" ] ; then
printf "PsMode= %s (correct)\n" $PSMODE >> $FILE
else
printf "PsMode= %s (should be set to 0)\n" $PSMODE >> $FILE
fi
echo "SLGMS Version= "$SLGMS_VER >> $FILE

echo "Database= "$DB >> $FILE


echo "DB Version= "$VER >> $FILE
echo "DB Path= "$DBPATH >> $FILE
if [ "$DB" = "ORACLE" ] || [ "$DB" = "Oracle" ] || [ "$DB" = "oracle" ] ; then
echo "Oracle SID= "$SID >> $FILE
fi
if [ -f '/tmp/masterscript_mode' ] ; then
printf "System Status:= %s\n" `cat /tmp/master_script_mode` >> $FILE
else
printf "System Status:= Undefined\n" >> $FILE
fi
if [ -f `/usr/bin/which perl` ] ; then
printf "Path to Perl:= %s\n" `/usr/bin/which perl` >> $FILE
else
printf "Path to Perl:= Not Found\n" >> $FILE
fi
if [ -d /opt/OV ] ; then
printf "SNMP Manager Version = %s\n" `/opt/OV/bin/ovversion` >> $FILE
fi
if [ -d /opt/tarantella ] ; then
if [ -f "/opt/tarantella/info/version.out" ] ; then
TTAVER=`basename "\`head -1 /opt/tarantella/info/version.out | \
sed -e 's;^;/;' -e 's; ;/;g' -e 's/(//' -e 's/)//'\`"`
printf "Tarantella Version: = %s\n" $TTAVER >> $FILE
else
echo "Please check README for notes on crontab setup for root user."
fi
fi
printf "\n" >> $FILE
printf "PATH= %s\n" $PATH >> $FILE

printf "\n" >> $FILE


printf "LD_LIBRARY_PATH= %s\n" $LD_LIBRARY_PATH >> $FILE
}
#
KERNEL()
{
case `uname -r` in
5.8|5.9)
# Checks the /etc/system file settings
# NS = New Setting CS = Current Setting PNS = Partial NS PCS = Partial CS
#
printf "Compare kernel configuration settings:\n" >> $FILE
printf "\n" >> $FILE
for NS in maxusers\=256 shminfo_shmseg\=600 shminfo_shmmni\=512 shminfo_shmmin\=
1 seminfo_semmns\=4096 seminfo_semmni\=4096 seminfo_semmnu\=4096
seminfo_semume\=85 seminfo_semmap\=512 seminfo_semmsl\=150 seminfo_semopm\=150
seminfo_semvmx\=32767 ; do
PNS=`echo $NS | sed -e 's;=; ;' | awk '{print $1}'`
CS=`sed -n "/^set.*:*$PNS/s;set.*:*$PNS;$PNS;p" /etc/system`
if echo $CS | grep $NS 2>&1 > /dev/null ; then
printf "%-25s

OK\n" $CS >> $FILE

else
if [ "$CS" = "" ] ; then
printf "%-25s

is not set.

Should be set to: %-25s\n" $PNS $NS >> $FILE

should be

%-25s\n" $CS $NS >> $FILE

else
printf "%-25s
fi
fi
done
#

MEM=`prtconf | awk '/Memory size/ {print $3}'`


printf "%s * .80\n" $MEM > $HDIR/bc.cmd
PMEM=`bc<$HDIR/bc.cmd`
#
printf "%.2f * 1048576\n" $PMEM > $HDIR/bc.cmd
VALUE=`bc<$HDIR/bc.cmd`
/bin/rm $HDIR/bc.cmd
NS=`printf "shminfo_shmmax=%.0f\n" $VALUE`
#
PNS=shminfo_shmmax
CS=`sed -n "/^set.*:*$PNS/s;set.*:*$PNS;$PNS;p" /etc/system`
#
if [ "$CS" -ge "$NS" ] ; then
printf "%-25s

OK\n" $CS >> $FILE

else
if [ "$CS" = "" ] ; then
printf "%-25s is not set. Should be set to: %-25s\n" $PNS $NS >> $FILE
else
printf "%-25s

should be

%-25s\n" $CS $NS >> $FILE

fi
fi

;;

5.10)
# Checks the /etc/system file settings
# NS = New Setting CS = Current Setting PNS = Partial NS PCS = Partial CS
#
printf "Compare kernel configuration settings:\n" >> $FILE
printf "\n" >> $FILE

for NS in maxusers\=256 seminfo_semmni=4096 seminfo_semmsl=256 seminfo_semopm=15


0 ; do
PNS=`echo $NS | sed -e 's;=; ;' | awk '{print $1}'`
CS=`sed -n "/^set.*:*$PNS/s;set.*:*$PNS;$PNS;p" /etc/system`
if echo $CS | grep $NS 2>&1 > /dev/null ; then
printf "%-25s

OK\n" $CS >> $FILE

else
if [ "$CS" = "" ] ; then
printf "%-25s

is not set.

Should be set to: %-25s\n" $PNS $NS >> $FILE

should be

%-25s\n" $CS $NS >> $FILE

else
printf "%-25s
fi
fi
done

printf "\n" >> $FILE


printf "Checking oracle setting requirements in /etc/user_attr:\n" >> $FILE
printf "\n" >> $FILE

USERATTR='oracle::::project=group.dba'

CATUSERATTR="`grep group.dba /etc/user_attr`"


if [ $? -eq "1" ] ; then
CATUSERATTR=empty
fi

if echo $USERATTR | grep $CATUSERATTR 2>&1 > /dev/null ; then


printf "%-28s OK\n" $CATUSERATTR >> $FILE
else
if [ $CATUSERATTR = "empty" ] ; then
printf "%-25s

is not set.

Should be set to: %-25s\n" group.dba $USERATTR

>> $FILE
else
printf "%-25s

should be

%-25s\n" group.dba $USERATTR >> $FILE

fi
fi

printf "\n" >> $FILE


printf "Checking oracle setting requirements in /etc/project:\n" >> $FILE
printf "\n" >> $FILE

PROJECT='group.dba:102:Oracle:oracle:dba:project.max-sem-ids=(privileged,128,den
y);process.max-sem-nsems=(privileged,512,deny);project.max-shm-i
ds=(privileged,128,deny);project.max-shm-memory=(privileged,1073741824,deny)'

CATPROJECT="`grep group.dba /etc/project`"


if [ $? -eq "1" ] ; then
CATPROJECT=empty
fi

if echo $PROJECT | grep $CATPROJECT 2>&1 > /dev/null ; then


printf "%-25s

OK\n" $CATPROJECT >> $FILE

else
if [ $CATPROJECT = "empty" ] ; then
printf "%-25s

is not set.

Should be set to:\n" group.dba >> $FILE

printf "%-25s\n" $PROJECT >> $FILE


else
printf "%-25s

should be\n" group.dba >> $FILE

printf "%-25s\n" $PROJECT >> $FILE


fi
fi

;;
esac

}
#
DBINFO()
{
printf "Check DB Space:\n" >> $FILE
#
if [ "$DB" = "INFORMIX" ] ; then
$INFORMIXDIR/bin/onstat -d >> $FILE
else
# Try to determine correct DB login info:

# Manaully set username and password here (remember to uncomment):


#ORAUSER=
#ORAPASSWD=

if [ ! -z "$ORAUSER" ] && [ ! -z "$ORAPASSWD" ] ; then


$ORACLE_HOME/bin/sqlplus ${ORAUSER}/${ORAPASSWD} << EOT 1>/var/tmp/otherdb
EOT
test -z "`grep \"invalid username\" /var/tmp/otherdb`" && DBADMIN="${ORAUSER}/${
ORAPASSWD}"
else
$ORACLE_HOME/bin/sqlplus netboss/netboss << EON 1>/var/tmp/netbossdb
EON

$ORACLE_HOME/bin/sqlplus hnmadm/hnmadm << EOA 1>/var/tmp/hnmadmdb


EOA

test -z "`grep \"invalid username\" /var/tmp/netbossdb`" && DBADMIN="netboss/net


boss"
test -z "`grep \"invalid username\" /var/tmp/hnmadmdb`" && DBADMIN="hnmadm/hnmad
m"
fi

if [ -z "$DBADMIN" ] ; then
echo " " >> $FILE
echo "Sorry. Incorrect DB Login." >> $FILE
echo "Please edit NBInfo.sh lines and manually set ORAUSER and ORAPASSWD" >> $FI
LE
echo "under DBINFO() function." >> $FILE
else
$ORACLE_HOME/bin/sqlplus -s netboss/netboss @$HDIR/calc_space.sql<<EOC | sed -e
'/rows selected/d' >> $FILE
quit
EOC

$ORACLE_HOME/bin/sqlplus -s netboss/netboss @$HDIR/hitratio.sql<<EOH >> $FILE


quit
EOH

$ORACLE_HOME/bin/sqlplus -s netboss/netboss @$HDIR/frag_info.sql<<EOF >> $FILE


quit
EOF
fi
fi

# Cleanup temp files in /var/tmp:


for TFILE in netbossdb hnmadmdb ; do
[ -f /var/tmp/${TFILE} ] && /bin/rm /var/tmp/${TFILE}
done

#
}
#
STATS()
{
printf "MPSTAT:\n" >> $FILE
printf "\n" >> $FILE
mpstat 3 5 >> $FILE
printf "\n" >> $FILE
printf "---------------------------------------------------------------------------\n" >> $FILE
printf "\n" >> $FILE
printf "IOSTAT:\n" >> $FILE
printf "\n" >> $FILE
iostat 3 5 >> $FILE
printf "\n" >> $FILE
printf "---------------------------------------------------------------------------\n" >> $FILE
printf "\n" >> $FILE
printf "VMSTAT:\n" >> $FILE
printf "\n" >> $FILE
vmstat 3 5 >> $FILE
}
#
CRON()
{
if [ -f /var/spool/cron/crontabs/$USER ] ; then
printf "NetBoss' crontab:\n" >> $FILE
printf "\n" >> $FILE
crontab -l >> $FILE
else

printf "NetBoss does not have a crontab\n" >> $FILE


fi
}
#
DF()
{
printf "Disk Space Check:\n" >> $FILE
printf "\n" >> $FILE
df -kF ufs | grep -v cdrom >> $FILE
}
#
SWAP()
{
printf "Summary of Swap:\n" >> $FILE
printf "\n" >> $FILE
swap -s >> $FILE
}
#
IPCS()
{
printf "Active Inter-process Communication Facilities Status Report:\n" >> $FILE
printf "\n" >> $FILE
ipcs -cp >> $FILE
}
#
TABS()
{
printf "Contents of /etc/vfstab:\n" >> $FILE
printf "\n" >> $FILE
more /etc/vfstab | /usr/bin/egrep -v "#/|fd|proc|swap" >> $FILE

printf "\n" >> $FILE


#
printf "---------------------------------------------------------------------------\n" >> $FILE
printf "\n" >> $FILE
printf "Contents of /etc/dfs/dfstab:\n" >> $FILE
more /etc/dfs/dfstab | /usr/bin/grep -v "^#" >> $FILE
}
#
LUX()
{
/usr/sbin/luxadm display FCloop 1>&2 2>/dev/null
[ "$?" = "0" ] && FCLOOP=true || FCLOOP=false

if [ "$FCLOOP" = "true" ] ; then


/usr/sbin/luxadm display FCloop | grep SSC100 1>&2 2>/dev/null
[ "$?" = "0" ] && SSC100=true || SSC100=false
fi

if [ "$SSC100" = "true" ] ; then


printf "Output of luxadm display FCloop | grep SSC100:\n" >> $FILE
printf "\n" >> $FILE
/usr/sbin/luxadm display FCloop | grep SSC100 >> $FILE
fi
}
#
WHODO()
{
printf "Statistics for current users\n" >> $FILE
printf "\n" >> $FILE

whodo -l >> $FILE


}
#
SGACHECK()
{
# Snapshot the Elements directories for tracking what versions of the SMAs are o
n the system.
printf "Snapshot of $ANMDIR/sga/Elements directory:\n" >> $FILE
printf "\n" >> $FILE
/usr/bin/ls -l $ANMDIR/sga/Elements | grep -v "^total" >> $FILE
}
#
TTAINFO()
{
# Checking tarantella license information
if [ -f "/opt/tarantella/info/license-query.out" ] ; then
printf "Output from tarantella license query:\n" >> $FILE
cat /opt/tarantella/info/license-query.out >> $FILE
fi

printf "\n" >> $FILE

if [ -f "/opt/tarantella/info/license-list.out" ] ; then
printf "Output from tarantella license list:\n" >> $FILE
cat /opt/tarantella/info/license-list.out >> $FILE
fi
}
#
META()
{
if [ -f /usr/sbin/metastat ] ; then

metastat 1>/dev/null 2>/dev/null


if [ $? -eq "0" ] ; then
printf "---------------------------------------------------------------------------\n" >> $FILE
printf "Status of metadevice(s) or hot spare pool:\n" >> $FILE
metastat >> $FILE
printf "\n" >> $FILE
printf "---------------------------------------------------------------------------\n" >> $FILE
printf "\n" >> $FILE
printf "---------------------------------------------------------------------------\n" >> $FILE
printf "Listing of boot devices:\n" >> $FILE
ls -l /dev/dsk/*s0 >> $FILE
printf "\n" >> $FILE
printf "---------------------------------------------------------------------------\n" >> $FILE
printf "\n" >> $FILE
fi
fi
}
#
if [ -f /usr/local/bin/setnetbossenv ] ; then
NBVER=PRE4.1
SETNETBOSSENV=/usr/local/bin/setnetbossenv
elif [ -f "${ANMDIR}/config/setnetbossenv" ] ; then
NBVER=POST4.1
SETNETBOSSENV=${ANMDIR}/config/setnetbossenv
else
echo "Not able to determine location of setnetbossenv file."
echo "Exiting." && exit 4
fi

#
ANMDIR=`grep "setenv ANMDIR " $SETNETBOSSENV | awk '{print $3}'`
$ANMDIR/bin/fms -ver 2>/tmp/ver
HNMV=`/usr/bin/cat /tmp/ver | fgrep "Manage.IT version"`
SLGMS_VER=`grep Release $GMS_HOME/* | head -1 | sed -e 's/^\/[A-Za-z0-9].*:# Con
figuration File for SL-GMS //'`
HDIR=$ANMDIR/NBInfo
HOST=`/usr/bin/hostname`
ROC=`/usr/bin/du -sk $ANMDIR/bin/roc | awk '{print $1}'`
USER=`/usr/bin/logname`

#
if [ "$INFORMIXDIR" != "" ] ; then
DB=INFORMIX
DBPATH=`echo $INFORMIXDIR`
VER=`$INFORMIXDIR/bin/dbaccess -V | head -1`
INFORMIXDIR=`grep "setenv INFORMIXDIR" $SETNETBOSSENV | awk '{print $3}'`
if [ "a${INFORMIXDIR}" = "a" ] ; then
echo "Unable to find INFORMIXDIR setting. Unsupported system configuration."
echo "Exiting."
exit 4
fi
else
DB=ORACLE
DBPATH=`echo $ORACLE_HOME`
VER=`$ORACLE_HOME/bin/sqlplus "-?" | grep "Release"`
SID=`echo $ORACLE_SID`
if [ -f /usr/local/bin/dbhome ] ; then
ORACLE_HOME=`/usr/local/bin/dbhome`
else

echo "Unable to find ORACLE_HOME setting. Unsupported system configuration."


echo "Exiting."
exit 5
fi
fi
#
# This will clean up any residual from the last install or update:
if [ -f $HDIR/cleanup ] ; then
/bin/sh $HDIR/cleanup
rm $HDIR/cleanup
fi
#
test -t 1 && clear
case $1 in
-ver|-v)
printf "\n"
printf "NBInfo.sh Revision Number:%s\n" $REV
printf "\n"
;;
-s)
printf "\n"
SYSINFO
printf "\n"
;;
#
-u)
printf "\n"
USERINFO
printf "\n"
;;

#
-q)
printf "Please Wait. Gathering System Information...\n"
#---------------------------------------------------------------------------------------------------------#
FILE=$HDIR/log/Quecheck.`date +%m-%d-%y.%H:%M:%S`
#
printf "\n" > $FILE
QUEUE
#
PPID
#
printf "\n" >> $FILE
roccont -s >> $FILE
printf "\n" >> $FILE
more $FILE
;;
#---------------------------------------------------------------------------------------------------------------debug)
# This is an undocumented feature used for debugging procedure updates/issues.
META
;;
#---------------------------------------------------------------------------------------------------------------B)

printf "Please Wait. Gathering System Information...\n"


#
FILE=$HDIR/log/Baseline.`date +%m-%d-%y.%H:%M:%S`
#

SYSINFO
printf "\n" >> $FILE
printf "---------------------------------------------------------------------------\n" >> $FILE
printf "\n" >> $FILE
USERINFO
printf "\n" >> $FILE
printf "---------------------------------------------------------------------------\n" >> $FILE
printf "\n" >> $FILE
DF
#
printf "\n" >> $FILE
printf "---------------------------------------------------------------------------\n" >> $FILE
printf "\n" >> $FILE
DBINFO
#
printf "\n" >> $FILE
printf "---------------------------------------------------------------------------\n" >> $FILE
printf "\n" >> $FILE
KERNEL
printf "\n" >> $FILE
printf "---------------------------------------------------------------------------\n" >> $FILE
printf "\n" >> $FILE
CRON
printf "\n" >> $FILE
printf "---------------------------------------------------------------------------\n" >> $FILE
printf "\n" >> $FILE
STATS

printf "\n" >> $FILE


printf "---------------------------------------------------------------------------\n" >> $FILE
printf "\n" >> $FILE
#
TABS
printf "\n" >> $FILE
printf "---------------------------------------------------------------------------\n" >> $FILE
printf "\n" >> $FILE
#
META
#
SWAP
printf "\n" >> $FILE
#
printf "---------------------------------------------------------------------------\n" >> $FILE
printf "\n" >> $FILE
#
IPCS
printf "\n" >> $FILE
#
printf "---------------------------------------------------------------------------\n" >> $FILE
printf "\n" >> $FILE
#
TTAINFO
printf "\n" >> $FILE
#
printf "---------------------------------------------------------------------------\n" >> $FILE

printf "\n" >> $FILE


#
LUX
printf "\n" >> $FILE
#
printf "---------------------------------------------------------------------------\n" >> $FILE
printf "\n" >> $FILE
#
SGACHECK
printf "\n" >> $FILE
#
more $FILE
;;
#
#---------------------------------------------------------------------------------------------------------------help|-h|-*)
cat << EOH

NBInfo.sh [-s] [-q] [-u] [-B] [-[v]er] [-[h]elp]

No Flag Gathers ALL Information (Log file name begins with NBInfo.)
-BRetrieve System Baseline (Log file name begins with Baseline.)
-sDisplay System Architecture (Does not get logged)
-qOnly gather queuerpc information (Log file name begins with Quecheck.)
-uUser Environment Information (Does not get logged)
-v or -verNBInfo.sh Revision Number (Does not get logged)
-h or -helpNBInfo.sh usage information

EOH

;;
#--------------------------------------------------------------------------------------------------------------*)
printf "Please Wait. Gathering System Information...\n"
#
FILE=$HDIR/log/NBInfo.`date +%m-%d-%y.%H:%M:%S`
#
printf "\n" > $FILE
SYSINFO
printf "\n" >> $FILE
printf "---------------------------------------------------------------------------\n" >> $FILE
printf "\n" >> $FILE
USERINFO
printf "\n" >> $FILE
printf "---------------------------------------------------------------------------\n" >> $FILE
printf "\n" >> $FILE
DF
#
printf "\n" >> $FILE
printf "---------------------------------------------------------------------------\n" >> $FILE
printf "\n" >> $FILE
#
SWAP
printf "\n" >> $FILE
#
printf "---------------------------------------------------------------------------\n" >> $FILE
printf "\n" >> $FILE
#

IPCS
printf "\n" >> $FILE
#
printf "---------------------------------------------------------------------------\n" >> $FILE
printf "\n" >> $FILE
DBINFO
#
printf "\n" >> $FILE
printf "---------------------------------------------------------------------------\n" >> $FILE
printf "\n" >> $FILE
KERNEL
printf "\n" >> $FILE
printf "---------------------------------------------------------------------------\n" >> $FILE
printf "\n" >> $FILE
CRON
printf "\n" >> $FILE
printf "---------------------------------------------------------------------------\n" >> $FILE
printf "\n" >> $FILE
TTAINFO
printf "\n" >> $FILE
printf "---------------------------------------------------------------------------\n" >> $FILE
printf "\n" >> $FILE
STATS
printf "\n" >> $FILE
printf "---------------------------------------------------------------------------\n" >> $FILE
printf "\n" >> $FILE
VP

printf "---------------------------------------------------------------------------\n" >> $FILE


printf "\n" >> $FILE
SGACHECK
printf "\n" >> $FILE
printf "---------------------------------------------------------------------------\n" >> $FILE
printf "\n" >> $FILE
WHODO
printf "\n" >> $FILE
#
more $FILE
;;
#
esac
:q1!
bash-3.2#

S-ar putea să vă placă și