Script for generating complete AIX system configurationSName=` hostname -s `DT=$(date +%d%b%y"_"%H%M)FL=/tmp/$SName"_config_"$DT".txt"; touch ${FL} export LANG=Cecho "\n aix_srv_config: Generating SW/HW configuration"
echo "\n\n\n C O N F I G U R A T I O N S U M M A R Y O U T P U T\n\n\n" > ${FL}echo "# date" >> ${FL} echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> ${FL} date >> ${FL}echo " " >> ${FL}
echo "# hostname -s" >> ${FL} echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> ${FL} hostname -s >> ${FL}echo " " >> ${FL}
echo "# df -k on $SName" >> ${FL} echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> ${FL} df -k >> ${FL}echo " " >> ${FL}
echo "# ifconfig -a on $SName" >> ${FL} echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> ${FL} ifconfig -a >> ${FL}echo "
file://n//n" >> ${FL} echo "# cat /etc/inittab on $SName" >> ${FL} echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> ${FL} cat /etc/inittab >> ${FL}echo "
file://n//n" >> ${FL}
echo "# cat /etc/syslog.conf on $SName" >> ${FL} echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> ${FL} cat /etc/syslog.conf >> ${FL}echo "
file://n//n" >> ${FL}
echo "# cat /etc/ntp.conf on $SName" >> ${FL} echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> ${FL} cat /etc/ntp.conf >> ${FL}echo "
file://n//n" >> ${FL}
echo "# cat /etc/passwd on $SName" >> ${FL} echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> ${FL} cat /etc/passwd >> ${FL}echo "
file://n//n" >> ${FL}
echo "# netstat -r on $SName" >> ${FL} echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> ${FL} netstat -r >> ${FL}echo "
file://n//n" >> ${FL}
echo "# netstat -rn on $SName" >> ${FL} echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> ${FL} netstat -rn >> ${FL}echo "
file://n//n" >> ${FL}
echo "# netstat -in on $SName" >> ${FL} echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> ${FL} netstat -in >> ${FL}echo "
file://n//n" >> ${FL}
echo "# netstat -rm on $SName" >> ${FL} echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> ${FL} netstat -rm >> ${FL}echo "
file://n//n" >> ${FL}
echo "# lsattr -El mem0 on $SName" >> ${FL} echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> ${FL} lsattr -El mem0 >> ${FL}echo "
file://n//n" >> ${FL}
echo "# lsattr -El sys0 on $SName" >> ${FL} echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> ${FL} lsattr -El sys0 >> ${FL}echo "
file://n//n" >> ${FL}
echo "# lsdev -Cc tape on $SName" >> ${FL} echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> ${FL} lsdev -Cc tape >> ${FL}echo "
file://n//n" >> ${FL}
cd /echo "# ls -l under / on $SName" >> ${FL} echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> ${FL} ls -l >> ${FL}echo "
file://n//n" >> ${FL}
echo "# ls -l grep ^d under / on $SName" >> ${FL} echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> ${FL} ls -l grep ^d >> ${FL}echo "
file://n//n" >> ${FL}
echo "# ls -l under /dev on $SName" >> ${FL} echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> ${FL} cd /dev ls -l >> ${FL} cd /echo "
file://n//n" >> ${FL}
echo "# showmount -e on $SName" >> ${FL} echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> ${FL} showmount -e >> ${FL}echo "
file://n//n" >> ${FL}
echo "# cat /etc/exports on $SName" >> ${FL} echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> ${FL} cat /etc/exports >> ${FL}echo "
file://n//n" >> ${FL}
echo "# cat /etc/hosts on $SName" >> ${FL} echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> ${FL} cat /etc/hosts >> ${FL}echo "
file://n//n" >> ${FL}
echo "# lsuser -a id home ALL on $SName" >> ${FL} echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> ${FL} lsuser -a id home ALL >> ${FL}echo "
file://n//n" >> ${FL}
echo "# cat /etc/group on $SName" >> ${FL} echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> ${FL} cat /etc/group >> ${FL}echo "
file://n//n" >> ${FL}
echo "# lsgroup -a id ALL on $SName" >> ${FL} echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> ${FL} lsgroup -a id ALL >> ${FL}echo "
file://n//n" >> ${FL}
#cd /etc#echo "# cat /etc/.rhosts on $SName" >> ${FL} #echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> ${FL} #cat /.rhosts >> ${FL} #echo "
file://n//n" >> ${FL}#cd /
echo "# oslevel on $SName" >> ${FL} echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> ${FL} echo "oslevel " `oslevel` >> ${FL} echo "oslevel -r " `oslevel -r` >> ${FL} echo "
file://n//n" >> ${FL}
echo "# instafix -i grep ML on $SName" >> ${FL} echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> ${FL} instfix -i grep ML >> ${FL} echo "
file://n//n" >> ${FL}
echo "# lspv on $SName" >> ${FL} echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> ${FL} lspv >> ${FL} echo "
file://n//n" >> ${FL} for i in $(lspv awk '{print $1}' ) do echo "# lspv $i on $SName" >> ${FL} echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> ${FL} lspv $i >> ${FL} echo "
file://n//n" >> ${FL} echo "# lspv -l $i on $SName" >> ${FL} echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> ${FL} lspv -l $i >> ${FL} echo "
file://n//n" >> ${FL} echo "# lspv -p $i on $SName" >> ${FL} echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> ${FL} lspv -p $i >> ${FL} echo "
file://n//n" >> ${FL} done
echo "# lsvg on $SName" >> ${FL} echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> ${FL} lsvg >> ${FL} echo "
file://n//n" >> ${FL}
echo "# lsvg -o on $SName" >> ${FL} echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> ${FL} lsvg -o >> ${FL} echo "
file://n//n" >> ${FL} for j in $(lsvg) do echo "# lsvg $j on $SName" >> ${FL} echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> ${FL} lsvg $j >> ${FL} echo "
file://n//n" >> ${FL} echo "# lsvg -l $j on $SName" >> ${FL} echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> ${FL} lsvg -l $j >> ${FL} echo "
file://n//n" >> ${FL}done
echo "# lsvpcfg on $SName" >> ${FL}echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> ${FL}lsvpcfg >> ${FL}echo "
file://n//n" >> ${FL}
echo "# User license on $SName" >> ${FL}echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> ${FL}lslicense >> ${FL}echo "
file://n//n" >> ${FL}
echo "# vmo on $SName" >> ${FL}echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> ${FL}vmo -a >> ${FL}echo >> ${FL}vmo -L >> ${FL}echo "
file://n//n" >> ${FL}
echo "# ioo on $SName" >> ${FL}echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> ${FL}ioo -a >> ${FL}echo >> ${FL}ioo -L >> ${FL}echo "
file://n//n" >> ${FL}
echo "# ulimits on $SName" >> ${FL}echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> ${FL}ulimit -a >> ${FL}echo "
file://n//n" >> ${FL} cd /var/spool/cron/crontabsfor i in $(ls)do echo "# crontab -l of $i on $SName" >> ${FL} echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> ${FL} cat $i >> ${FL} echo "
file://n//n" >> ${FL}done
cd /var/spool/cron/atjobsfor i in $(ls)do echo "# atjobs -l of $i on $SName" >> ${FL} echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> ${FL} cat $i >> ${FL} echo "
file://n//n" >> ${FL}donecd
#echo "# errpt > /tmp/$SName"_errpt_"$DT".txt" " >> ${FL}#echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> ${FL}#errpt > /tmp/$SName"_errpt_"$DT".txt"#chmod o+r /tmp/$SName"_errpt_"$DT".txt"#echo "
file://n//n" >> ${FL}
#echo "# errpt -a > /tmp/$SName"_errpta_"$DT".txt" " >> ${FL}#echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> ${FL}#errpt -a > /tmp/$SName"_errpta_"$DT".txt"#chmod o+r /tmp/$SName"_errpta_"$DT".txt"#echo "
file://n//n" >> ${FL}
#echo "# lslpp -l grep cluster* on $SName " >> ${FL}#echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> ${FL}#lslpp -l grep clust* >> ${FL}#echo "
file://n//n" >> ${FL}
#echo "# lssrc -g cluster on $SName " >> ${FL}#echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> ${FL}#lssrc -g clust* >> ${FL}#echo "
file://n//n" >> ${FL}
#echo "# HACMP Cluster Config info $SName " >> ${FL}#echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> ${FL}#/usr/es/sbin/cluster/utilities/cltopinfo >> ${FL}#RGP=$(/usr/es/sbin/cluster/utilities/cltopinfogrep "Resource Group"cut -f3 -d" ")#echo >> ${FL}#/usr/es/sbin/cluster/utilities/clshowres -g $RGP >> ${FL}#echo "
file://n//n" >> ${FL}
echo "# lslpp -l " >> ${FL}echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> ${FL}lslpp -l >> ${FL}echo "
file://n//n" >> ${FL}
echo "# lscfg -vp " >> ${FL}echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> ${FL}lscfg -vp >> ${FL} echo "
file://n//n" >> ${FL}
echo "# prtconf " >> ${FL}echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> ${FL}prtconf >> ${FL} echo "
file://n//n" >> ${FL}
echo "# lppchk -v" >> ${FL}echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> ${FL}lppchk -v >> ${FL}echo "
file://n//n" >> ${FL}
echo "# lppchk -c" >> ${FL}echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> ${FL}lppchk -c >> ${FL}echo "
file://n//n" >> ${FL}
echo "# list of created file with the script" >> ${FL}echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> ${FL}ls -ltr /tmp/*$DT* >> ${FL}echo "
file://n//n" >> ${FL}cd if [ $# -ne 0 ]then echo "aix_srv_config: usage: aix_srv_config" echo " NO PARAMETERS ARE REQUIRED" exit -1fi
echo "\n\nHostname: " `/bin/hostname -s` >> ${FL}echo "Time config run: " `/bin/date` >> ${FL}echo "AIX VRLM (oslevel): " `oslevel` >> ${FL}
echo "\n\nPROCESSOR TYPE (uname -m)" >> ${FL}echo "--------------------------\n" >> ${FL}uname -m >> ${FL}echo " ## = model" >> ${FL}
echo "\n\nMEMORY (bootinfo -r): " `bootinfo -r` >> ${FL}echo "MEMORY (lscfg -l memN)" >> ${FL}echo "-----------------------\n" >> ${FL}lscfg -l mem* >> ${FL}
# get current paging space infoecho "\n\nPAGING SPACES (lsps -a)" >> ${FL}echo "------------------------\n" >> ${FL}lsps -a >> ${FL}
echo "\n\nPAGING SPACES (lsps -s)" >> ${FL}echo "------------------------\n" >> ${FL}lsps -s >> ${FL}
echo "\n\nHARDWARE DETAILS" >> ${FL}echo "----------------\n" >> ${FL}lsdev -C /bin/grep Available /bin/awk 'BEGIN { FS = "-" }/-/ { LINE=substr($0,24,70) ; printf LINE "\n" }' /bin/sort /bin/awk 'BEGIN {}/^-00-0K-/ { DATA=substr($0,11,70) ; printf " " DATA "\n"}/^-00-S1 / { DATA=substr($0,11,70) ; printf " " DATA "\n"}/^-00-S1-/ { DATA=substr($0,11,70) ; printf " -- " DATA "\n"}/^-00-S2 / { DATA=substr($0,11,70) ; printf " " DATA "\n"}/^-00-S2-/ { DATA=substr($0,11,70) ; printf " -- " DATA "\n"}/^-00-0P / { DATA=substr($0,11,70) ; printf " " DATA "\n"}/^-00-0P-/ { DATA=substr($0,11,70) ; printf " -- " DATA "\n"}/^-01 / { DATA=substr($0,11,70) ; printf "Slot 1 contains " DATA "\n"}/^-01-0/ { DATA=substr($0,11,70) ; printf " -- " DATA "\n"}/^-02 / { DATA=substr($0,11,70) ; printf "Slot 2 contains " DATA "\n"}/^-02-0/ { DATA=substr($0,11,70) ; printf " -- " DATA "\n"}/^-03 / { DATA=substr($0,11,70) ; printf "Slot 3 contains " DATA "\n"}/^-03-0/ { DATA=substr($0,11,70) ; printf " -- " DATA "\n"}/^-04 / { DATA=substr($0,11,70) ; printf "Slot 4 contains " DATA "\n"}/^-04-0/ { DATA=substr($0,11,70) ; printf " -- " DATA "\n"}/^-05 / { DATA=substr($0,11,70) ; printf "Slot 5 contains " DATA "\n"}/^-05-0/ { DATA=substr($0,11,70) ; printf " -- " DATA "\n"}/^-06 / { DATA=substr($0,11,70) ; printf "Slot 6 contains " DATA "\n"}/^-06-0/ { DATA=substr($0,11,70) ; printf " -- " DATA "\n"}/^-07 / { DATA=substr($0,11,70) ; printf "Slot 7 contains " DATA "\n"}/^-07-0/ { DATA=substr($0,11,70) ; printf " -- " DATA "\n"}/^-08 / { DATA=substr($0,11,70) ; printf "Slot 8 contains " DATA "\n"}/^-08-0/ { DATA=substr($0,11,70) ; printf " -- " DATA "\n"}' >> ${FL}
# get detail device infoecho "\f\n\nPHYSICAL / LOGICAL DEVICE DETAILS (lsdev -C)" >> ${FL}echo "---------------------------------------------\n" >> ${FL}lsdev -C >> ${FL}
# get current physical volume namesecho "\f\n\nPHYSICAL VOLUMES (lspv)" >> ${FL}echo "------------------------\n" >> ${FL}lspv >> ${FL}
# get detail physical volume infofor i in `lspv /bin/cut -c1-15` do echo "\n\nPHYSICAL VOLUME DETAILS FOR $i (lspv -l $i)" >> ${FL} echo "------------------------------------------------------\n" >> ${FL} lspv -l $i >> ${FL} 2>&1 done
# get detail volume group infofor i in `lsvg -o` do echo "\n\nVOLUME GROUP DETAILS (lsvg -l $i)" >> ${FL} echo "---------------------------------------\n" >> ${FL} lsvg -l $i >> ${FL} done
# get current mount infoecho "\f\n\nMOUNTED FILESYSTEMS (mount)" >> ${FL}echo "----------------------------\n" >> ${FL}mount >> ${FL}
echo "\n\nFILE SYSTEM INFORMATION: (lsfs -q)" >> ${FL}echo "-----------------------------------\n" >> ${FL}lsfs -q >> ${FL} 2>&1
echo "\n\nFILE SYSTEM SPACE: (df)" >> ${FL}echo "------------------------\n" >> ${FL}df >> ${FL}
for LV in $(lsvg -olsvg -ilawk '{print $1}'egrep -v ':LV') do echo "\n\nLOGICAL VOLUME DETAILS (lslv $LV)" echo "---------------------------------------\n" lslv $LV echo done >> ${FL}
# collect schedtune and vmtune current settingsecho "\n\nSCHEDTUNE SETTINGS (schedtune)" >> ${FL}echo "--------------------------------\n" >> ${FL}if [ -f /usr/samples/kernel/schedtune ] then /usr/samples/kernel/schedtune >> ${FL} else echo "/usr/samples/kernel/schedtune not installed" >> ${FL} echo " This program is part of the bos.adt.samples fileset" >> ${FL} fi
echo "\n\nVMTUNE SETTINGS (vmtune)" >> ${FL}echo "-------------------------\n" >> ${FL}if [ -f /usr/samples/kernel/vmtune ] then /usr/samples/kernel/vmtune >> ${FL} else echo "/usr/samples/kernel/vmtune not installed" >> ${FL} echo " This program is part of the bos.adt.samples fileset" >> ${FL} fi# get verbose machine configuration# added because it is the only way to tell between 601 and 604 upgrades#echo "\f\n\nVERBOSE MACHINE CONFIGURATION (lscfg -v)" >> ${FL}#echo "-----------------------------------------\n" >> ${FL}lscfg -v >> ${FL}
# get system dump config infoecho "\n\nSYSTEM DUMP INFO (sysdumpdev -l;sysdumpdev -e)" >> ${FL}echo "----------------------------------------------\n" >> ${FL}sysdumpdev -l >> ${FL}sysdumpdev -e >> ${FL}
# get ulimit valuesecho "\n\nulimit values" >> ${FL}echo "----------------------------------------------\n" >> ${FL}ulimit -a >> ${FL}
# get sample iostatecho "\n\nsample iostats" >> ${FL}echo "----------------------------------------------\n" >> ${FL}iostat 1 5 >> ${FL}
# get sample vmstatecho "\n\nsample vmstats" >> ${FL}echo "----------------------------------------------\n" >> ${FL}vmstat 1 5 >> ${FL}
# get inittab setupecho "\n\ninittab setup" >> ${FL}echo "----------------------------------------------\n" >> ${FL}tail /etc/inittab >> ${FL}
# get sync daemon setupecho "\n\nsync daemon setup" >> ${FL}echo "----------------------------------------------\n" >> ${FL}ps -ef grep syncd >> ${FL}
# get syslog setupecho "\n\nis syslog daemon running " >> ${FL}echo "----------------------------------------------\n" >> ${FL}ps -ef grep syslo* >> ${FL}echo "\n\nsyslog setup " >> ${FL}echo "----------------------------------------------\n" >> ${FL}tail /etc/syslog.conf >> ${FL}
# TCP KeepIdle Param Valueecho "\n\nTCP KeepIdle Setup" >> ${FL}echo "----------------------------------------------\n" >> ${FL}no -o tcp_keepidle >> ${FL}
# Users on systemecho "\n\nUsers on system" >> ${FL}echo "----------------------------------------------\n" >> ${FL}w -u >> ${FL}
chmod o+r ${FL}chmod o+r ${FL}clearecho "
file://n//n//n//n"echo "Please take a copy of ${FL} file ... and ... "echo "
file://n/"ls -ltr /tmp/*$DT* awk '{print $9}'echo "
file://n//n"