You cannot see this page without javascript.

메뉴 건너뛰기

WHKorea

OS AIX SYSTEM CHECK SCRIPT

구피천사 2020.04.10 09:56 조회 수 : 1524

#!/bin/ksh
############################################################
# AIX SYSTEM CHECK SCRIPT        #
############################################################


export LANG=C
DATE=`date +%m%d%y`
HOSTNAME=`hostname`
REPORT=./checklist.$HOSTNAME.$DATE.txt
HACMPSNAP=/usr/es/sbin/cluster/snapshots/snap.$HOSTNAME.$DATE.*
exec > $REPORT 2>&1

cd /tmp
echo "==================================================================================="
echo "HOSTNAME               `hostname` "
echo "==================================================================================="
echo "Basic Info"
echo "Number of CPU   `lsdev -C|grep proc|grep Ava|wc -l`"
echo "Memory Size      `bootinfo -r` byte "
echo "AIX Level  `oslevel -r`"
echo "Kernel Info  `bootinfo -K` bit"
echo "Boot Disk  `bootinfo -b`"
echo "Model Name  `lsattr -El sys0|grep modelname |awk '{print $2 }'`"
echo "Serial No  `lsattr -El sys0|grep systemid |awk '{print $2 }'`"
echo "fwversion  `lsattr -El sys0|grep fwversion |awk '{print $2 }'`"
echo "AIX Level  `oslevel -r`"
echo "AIX Level  `instfix -i |grep ML`"
echo "==================================================================================="
lsattr -El sys0
echo "==================================================================================="
echo " VolumeGroup Info "
echo "==================================================================================="
lsvg
echo "--Varyonvg--------------------------------------------------------------------------------"
lsvg -o
echo "==================================================================================="
lsvg -o >/tmp/lsvg.out
lspv |awk '{print $1 }' >/tmp/lspv.out
for i in `cat /tmp/lsvg.out`
do
echo "----`echo $i` Logical Info----"
lsvg $i
echo "------------------------------------------------------------------------------------------"
lsvg -l $i
echo "------------------------------------------------------------------------------------------"
done
echo "==================================================================================="
echo " PV Info"
echo "==================================================================================="
lspv
echo "------------------------------------------------------------------------------------------"
for i in `cat /tmp/lspv.out`
do
echo "----`echo $i` Info----"
lspv $i
echo "------------------------------------------------------------------------------------------"
lspv -l $i
echo "------------------------------------------------------------------------------------------"
done
echo " "
echo "==============================================================================="
echo " Filesystem Info"
echo "==============================================================================="
echo " "
lsfs
echo "------------------------------------------------------------------------------------------"
df -g
echo " "
echo "==============================================================================="
echo " Network Info"
echo "==============================================================================="
lsdev -Cc adapter|grep ent
lsdev -Cc adapter|grep ent |awk '{print $1 }' | while read ENT
do
echo "------------------------------------------------------------------------------------------"
echo $ENT
lsattr -El $ENT
done
echo "------------------------------------------------------------------------------------------"
ifconfig -a
echo "------------------------------------------------------------------------------------------"
lsattr -El inet0
echo "------------------------------------------------------------------------------------------"
netstat -rn
echo "--DNS INFO & netsvc.conf------------------------------------------------------------------"
cat /etc/resolv.conf
grep hosts /etc/netsvc.conf
echo "--Hardware info------------------------------------------------------------------"
prtconf
echo "--N/W parameter---------------------------------------------------------------------------"
echo " Thewall :  `no -a |grep thewall |awk '{print $3}'` "
echo " sb_max  :  `no -a |grep sb_max |awk '{print $3}'` "
echo " rfc1323 :  `no -a |grep rfc1323 |awk '{print $3}'` "
echo " ipforwarding   : `no -a |grep ipforwarding |awk '{print $3}'` "
echo " tcp_pmtu_discover : `no -a |grep tcp_pmtu_discover |awk '{print $3}'` "
echo " udp_pmtu_discover : `no -a |grep udp_pmtu_discover |awk '{print $3}'` "
echo " sendspace :"
no -a |grep sendspace |awk '{print $1, $3}'
echo " recvspac : "
no -a |grep recvspace |awk '{print $1, $3}'
echo "--/etc/rc.net parameter-------------------------------------------------------------------"
grep "no -o" /etc/rc.net
echo " "
echo " "
echo "==============================================================================="
echo " Adapter Info"
echo "==============================================================================="
echo " "
lsslot -c pci
echo " "
lsdev -Cc adapter
echo " "
lsdev -Cc tape
echo " "
echo "=============================================================================="
echo " Page Space  Info"
echo "=============================================================================="
echo " "
lsps -a
echo " "
echo "=============================================================================="
echo " Processor  Info"
echo "=============================================================================="
echo " "
ps aux
echo " "
echo "=============================================================================="
echo " INSTALLED RESOURCE LIST "
echo "=============================================================================="
echo " "
echo "--lscfg ----------------------------------------------------------------------------------"
lscfg
echo "--lscfg -v -------------------------------------------------------------------------------"
lscfg -v
echo "------------------------------------------------------------------------------------------"
echo " "
echo "============================================================================="
echo "  Subsystem "
echo "============================================================================="
echo " "
lssrc -a
echo " "
echo "============================================================================="
echo "  HACMP "
echo "============================================================================="
echo " "
echo " Cluster info "
/usr/es/sbin/cluster/utilities/cllsclstr
echo " "
echo " Cluster Node info "
/usr/es/sbin/cluster/utilities/cllsnode
echo " "
echo " Cluster Node interface info "
/usr/es/sbin/cluster/utilities/cllsif
echo " "
echo " Cluster resources group "
/usr/es/sbin/cluster/utilities/cllsgrp
echo " "
echo " Cluster resource group information "
/usr/es/sbin/cluster/utilities/cllsgrp  | while read REG
do
/usr/es/sbin/cluster/utilities/clshowres -g $REG
done
echo " "
echo "============================================================================"
echo "  rc.net & rc.tcpip & inittab & crontab  list"
echo "============================================================================"
echo "--rc.net---------------------------------------------------------------------------------"
cat /etc/rc.net
echo "--rc.tcpip ------------------------------------------------------------------------------"
cat /etc/rc.tcpip
echo "--inittab -------------------------------------------------------------------------------"
cat /etc/inittab
echo "--crontab -l -------------------------------------------------------------------------------"
lsuser ALL |awk '{print $1}'|while read USER
do
echo "-- $USER  -------------------------------------------------------------------------------"
su - $USER -c crontab -l
done
echo " "
echo "============================================================================="
echo "  lpp list & check & errpt list"
echo "============================================================================="
echo " "
echo "--lppchk -v ------------------------------------------------------------------------------"
lppchk -v
echo "--lppchk -f ------------------------------------------------------------------------------"
lppchk -f
echo "--errpt ----------------------------------------------------------------------------------"
lslpp -l
echo "--errpt ----------------------------------------------------------------------------------"
errpt -s 0101000006
echo "============================================================================"

 

 

 

 

위로