로그인
Sign in
Process 의 비정상적인 종료시 Core Dump 파일이 생기고, 시스템의 비정상적인 종료시 Crash Dump 파일이 생기죠?  



하지만 대부분의 운영자및엔지니어가 비정상적인 종료에 대한 원인을 파악하기 위해 Dump 파일을 분석하려하지만 생각같이 쉽지많은 않다는것을 느낄껍니다.  

Dump 파일이 Binary 파일이기 때문일꺼라 생각이 듭니다.




지금 올려드리는 스크립트는 Crash 파일이 생성되었을때 손쉽게 문제의 원인을 파악하고, 해당시스템의 환경까지 전부 분석을 자동으로 해주는 스크립트입니다



**************************************************************************
**************************************************************************



사용방법은 File 내에 나와 있지만 간략히 설명드리면 다음과 같습니다.


1. 해당파일을 /var/crash/`hostname`   아래에 넣습니다.


2. 해당파일에 실행퍼미션을 주셔야죠! ^^;  
    #  chmod 755 analysis.sh


3. 분석하고자 하는 Crash Dump 파일을 아규먼트로 입력합니다.
    #  analysis.sh unix.0 vmcore.0


자동으로 분석이 주~루~룩.............




분석내용을 파일로 받으실려면,

    #  /var/crash/`hostnme`/analysis.sh  unix.0 vmcore.0  >>  analysis.txt



분석된파일을 보시고 Panic의 원인을 파악하시면 되겠죠..........






#  vi /var/crash/`hostnme`/analysis.sh         (아래문서를 카피해서 만드세요.....)


#  chmod 744 /var/crash/`hostnme`/analysis.sh






###########################################################################
#!/bin/sh
#
# Developed by Sun Microsystems, Inc.
# 2550 Garcia Avenue
# Mountain View, California 94043
#
# Copyright (c) 1996, Sun Microsystems, Inc.
#
# RESTRICTED RIGHTS: Use, duplication or disclosure by the government is
# subject to the restrictions as set forth in
# subparagraph (c) (1) (ii) of the Rights in Technical Data and Computer
# Software Clause as DFARS 252.227-7013 and FAR 52.227-19.
#
# SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF
# THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
# IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
# PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
# SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS
# SOFTWARE OR ITS DERIVATIVES.
#
# By using or copying this Software, Licensee agrees to abide by the
# intellectual property laws, and all other applicable laws of the U.S.,
# and the terms of this license.
#

# ----------------------------------------------------------------------
#
#  iscda -- Script to print out Initial System Crash Dump Analysis
#
#  History:
#
#    Edit 1   940707   krb   First script for Solaris 2.3, Rev 1.0
#    Edit 2   950220   krb   Ported to Solaris 2.4
#    Edit 3   950830   krb   Time to start cleaning this up a bit
#    Edit 4   960122   cjd   Some 2.4 changes; put in more "conditional"
#        execution of specific commands.
#
#  Files this script creates:
#
#    /tmp/iscda.{pid}
#
#  Notes:
#
#    This script must be run on the same kernel architecture and
#    under the same OS as the system crash dump we are analyzing.
#
# ----------------------------------------------------------------------

if [ ! $# = 2 ]
then
echo
echo "Usage:   iscda  unixfile  corefile  > your-output-file"
echo
echo "Examples:  iscda  unix.3  vmcore.3"
echo "           iscda  /dev/ksyms  /dev/mem"
echo
exit
fi

#
#  Make sure we can see the files.
#
if [ ! -f $1 ] && [ ! $1 = "/dev/ksyms" ]
then
echo; echo "Unable to locate $1.  Exiting."
echo; exit
fi
if [ ! -f $2 ] && [ ! $2 = "/dev/mem" ]
then
echo; echo "Unable to locate $2.  Exiting."
echo; exit
fi

PATH=${PATH}:/etc
export PATH

# Find the release we're dealing with.
rel=`echo '$<utsname' | adb -k $1 $2 | grep release | sed 's/^.* //'`
case "$rel" in
5.4)
PROCOFFSET=268
;;
5.*)
PROCOFFSET=260
;;
*)
echo "Operating system release $rel is not supported by this script."
exit
;;
esac

#
#  Okay, we are ready!  Create and put some stuff into output file.
#
echo "Working....."
cat <<EOC

******************************************************************************
Initial System Crash Dump Analysis Output                        iscda Rev 1.4
`date`
******************************************************************************

EOC


#
#  We will be creating our own macros for use in adb sessions.
#  Odds are we will create a unique filename if we use the PID.
#  If it is not unique, let the user do something about it.
#
WHERE=/tmp/iscda.$$
if [ -f $WHERE ]
then
echo; echo "File $WHERE already exists.  Exiting."
echo; exit
fi

#
#  proc address is offset by a different number depending on the
#  release.  Computed above.
#

cat > $WHERE <<EOC
*(<c+0t28)>n
<c+8/X"Thread address"
*(<c+8)>p
<p+a0/X"Proc address"
*(<p+a0)>j
<j+${PROCOFFSET}/s
.,#((*(<c+8))-(*(<c+c)))="This CPU was idle"
0,#(#(<n))&#(#(<n-<e))=n"Next CPU..."n
<n>c
<n,#(#(<n))&#(#(<n-<e))\$<$WHERE
EOC


#
#  Get initial information from adb
#
cat <<EOC
************************************
**  Initial information from adb  **
************************************

EOC

adb -k $1 $2 <<EOA
\$<utsname
srpc_domain/s16t"Domain name"
lbolt>a
*time-(*<a%0t100)=Y16t"Time of boot"
time/Y16t"Time of crash"
,#(*audit_active)=n"Auditing is not enabled"
,##(*audit_active)=n"Auditing is enabled"
,#(*quotas_initialized)=n"Quotas are not enabled"
,##(*quotas_initialized)=n"Quotas are enabled"
=nn"**  Panic String  **"
="--------------------"
*panicstr/s
=nn"**  Stack Backtrace  **"
="-----------------------"
\$c
=nn"**  Per CPU information  **"
="---------------------------"
ncpus/X"# of CPUs present"
ncpus_online/X"# of CPUs online"
=nn
*cpu_list>c
<c>e
<c,#(<c)="The cpu_list pointer is NULL.  Not a good sign."n
<c,#(#(<c))\$<$WHERE
=nn"**  Stacktrace  **"
="-----------------"
<sp\$<stacktrace
=nn
="**  CPU structures  **"
="--------------------"
\$<cpus
=nn
="**  Msgbuf  **"
="------------"
\$<msgbuf
EOA

cat > $WHERE <<EOC
=nn"**  System is sun4m architecture - Checking enable_sm_wa  **"
="------------------------------------------------------------"
cpunodes/s
enable_sm_wa/D
,##(*enable_sm_wa)="Patch 101406 is installed"
,#(*enable_sm_wa)="Patch 100406 is not installed"
EOC

adb -k $1 $2 <<EOA
0,#(*(utsname+408)-6d000000)\$<$WHERE
EOA

#
#  Get process information by using crash.
#
cat <<EOC


**************************************
**  Process information from crash  **
**************************************

EOC
crash -d $2 -n $1 <<EOC
p -e
EOC


#
#
#  Get strings output to capture message buffer.
#
cat <<EOC



******************************************************
**  Strings output of complete message ring buffer  **
******************************************************

EOC
strings $2 | head -200


#
#  Additional adb stuff
#
cat <<EOC

***********************
**  Some Statistics  **
***********************
EOC

case "$rel" in
5.4)
#
## Get DNLC out of adb, kma out of crash.
## Streams stats are not available.
#
adb -k $1 $2 <<EOA
=nn"**  Directory Name Lookup Cache Statistics  **"
="----------------------------------------------"
ncsize/D"Directory name cache size"
ncstats/D"# of cache hits that we used"
+/D"# of misses"
+/D"# of enters done"
+/D"# of enters tried when already cached"
+/D"# of long names tried to enter"
+/D"# of long name tried to look up"
+/D"# of times LRU list was empty"
+/D"# of purges of cache"
*ncstats+*(ncstats+4)+*(ncstats+14)>n
*ncstats*0t100%<n=D"Hit rate percentage"
="(See /usr/include/sys/dnlc.h for more information)"
EOA
cat <<EOC
**  Kernel Memory Request Statistics  **
----------------------------------------
EOC
crash -d $2 -n $1 <<EOC
kmastat
EOC
;;
5.*)
#
## For 5.3 and earlier, DNLC stats, streams stats,
## and kma stats are available through adb.
#
adb -k $1 $2 <<EOA
=nn"**  Directory Name Lookup Cache Statistics  **"
="----------------------------------------------"
ncsize/D"Directory name cache size"
ncstats/D"# of cache hits that we used"
+/D"# of misses"
+/D"# of enters done"
+/D"# of enters tried when already cached"
+/D"# of long names tried to enter"
+/D"# of long name tried to look up"
+/D"# of times LRU list was empty"
+/D"# of purges of cache"
*ncstats+*(ncstats+4)+*(ncstats+14)>n
*ncstats*0t100%<n=D"Hit rate percentage"
="(See /usr/include/sys/dnlc.h for more information)"
=nn"**  Kernel Memory Request Statistics  **"
="----------------------------------------"
="Small"16t"Large"16t"Outsized"
kmeminfo/3X"Owned by kmem"
+/3X"Mem allocated"
+/3X"# of failures"n
pagesize/D"Memory page size"
="(See /usr/include/sys/sysinfo.h for more information)"
=nn"**  Streams Statistics  **"
="--------------------------"
="In use"16t"Total"16t"Maximum"16t"Failures"
strst/4X"Streams"
+/4X"Queues"
+/4X"MsgBlks"
+/4X"LinkBlks"
="(See /usr/include/sys/strstat.h for more information)"
EOA
;;
*)
;;
esac



#
#  Print out some of the tunable variables.  Do this via macros
#  so that we don't get alot of symbol not found messages if
#  the driver was not modloaded for use.
#
cat > $WHERE <<EOC
=nn"**  Shared Memory Tuning Variables (if in use)  **"
="--------------------------------------------------"
shminfo_shmmax/D"Max segment size"
+/D"Min segment size"
+/D"Max identifiers"
+/D"Max attached shm segs per proc"
EOC

adb -k $1 $2 <<EOA
\$<$WHERE
EOA

cat > $WHERE <<EOC
=nn"**  Semaphore Tuning Variables (if in use)  **"
="----------------------------------------------"
seminfo_semmap/D"Entries per map"
+/D"Max identifiers"
+/D"Max in system"
+/D"Max undos"
+/D"Max sems per id"
+/D"Max ops per semop"
+/D"Max undos per proc"
+/D"Max bytes in undos"
+/D"Max sem value"
+/D"Max adjust on exit"
EOC

adb -k $1 $2 <<EOA
\$<$WHERE
EOA

cat > $WHERE <<EOC
=nn"**  Message Queue Tuning Variables (if in use)  **"
="--------------------------------------------------"
msginfo_msgmap/D"Max entries in map"
+/D"Max message size"
+/D"Max bytes on queue"
+/D"Max msg queue ids"
+/D"Max segment size (word size multiple)"
+/D"Max system message headers"
+/d16t"Max msg segments (must be < 32768)"
EOC

adb -k $1 $2 <<EOA
\$<$WHERE
EOA


##
## optional - eats up lots of space
##
#
#############################################
#panicstring=`echo "*panicstr/s" | adb -k $1 $2 | sed -e '1d' -e 's/^.* //' | head -1`
#if [ "$panicstring" = "zero" ] ; then
#adb -k $1 $2 << EOA
#\$<threadlist
#EOA
#fi
#

rm $WHERE

#
## Get some basic configuration information which is always
## useful.
#
cat << EOC

************************************
**  Current patch revision status **
************************************
EOC
showrev -p

cat << EOC

****************************************
** Hardware Configuration Information **
****************************************
EOC
prtconf -vp

echo "*****"
echo "Done!"

############################################
#
#  +---------------------------------------------------------------------+
#  |  For more information about system crash dump analysis, refer to    |
#  |  the SunSoft Press book, "Panic! UNIX System Crash Dump Analysis",  |
#  |  ISBN 0-13-149386-8, published by Prentice Hall.                    |
#  +---------------------------------------------------------------------+
#
############################################
#
#  end of iscda
#



출처 : http://www.wowunix.com
조회 수 :
2894
추천 수 :
15 / 0
등록일 :
2009.08.25
10:19:08 (*.236.3.225)
엮인글 :
http://bestceok.com/xe/index.php?mid=sun_faq&document_srl=3045&act=trackback&key=e15
게시글 주소 :
http://bestceok.com/xe/index.php?mid=sun_faq&document_srl=3045
List of Articles
번호 제목 글쓴이 조회 수 추천 수 비추천 수 날짜
171 Fault Manager 사용 하록 727     2012-06-25
fmadm faulty fmdump -v -u 89f881e4-91c7-cc7d-d498-b67ad9d0ce35 psrinfo로 CPU 상태 체크  
170 Fast Data Access MMU Miss 에러시... [1] 하록 2174     2012-02-24
ok boot cdrom -s ERROR: Fast Data Access MMU Miss debugger entered. ------------------------------------- 시스템과 맞는 OS인지 확인... 최신버전의 OS는 구버전 시스템에서는 읽을 수 없음  
169 디스크 부하율 체크 하록 828     2011-09-19
iostat -xcnCXTdz  
168 netapp 명령어 하록 2838     2010-08-19
Pocket guide for netapp commands This post contains the list of commands that will be most used and will come handy when managing or monitoring or troubleshooting a Netapp filer. •sysconfig -a : shows hardware configuration with more verbose...  
167 Duplex 변경 방법... 하록 1127     2010-05-11
아래에... ForceSpeedDuplex=7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7; 을 변경... 7,7을 4,4 등으로 바꿔주면 됨... 인스턴스가 0부터 15까지 있는데.. e1000g0 ~ e1000g15까지임.. 순서대로 4로 바꿔주면 됨... 나머지 것들도 마찬가지... vi /kernel/drv/e1000g.co...  
166 Duplex 변경 방법... [3] 하록 1591     2010-07-05
------------------------------------------------------------------------------------------------------------ Network ndd parameter setting Date : 28 -Oct -2008 By : dssong ---------------------------------------------------------------------...  
165 모니터 해상도 변경 하록 1123     2009-08-25
1. VGA 카드 종류 확인 # prtconf -F /SUNW,ffb@2,0:ffb0 2. vga 카드 관련 명령어 확인 # ls -l /usr/sbin/*config lrwxrwxrwx 1 root root 9 2002년 8월 29일 /usr/sbin/GFXconfig -> pgxconfig* -r-sr-xr-x 1 root bin 61508 1999년 12월 9일 /usr/sbin/afb...  
» Crash Dump 분석 방법 하록 2894 15   2009-08-25
Process 의 비정상적인 종료시 Core Dump 파일이 생기고, 시스템의 비정상적인 종료시 Crash Dump 파일이 생기죠? 하지만 대부분의 운영자및엔지니어가 비정상적인 종료에 대한 원인을 파악하기 위해 Dump 파일을 분석하려하지만 생각같이 쉽지많은 않다는것을...  
163 ftpaccess 파일 설명 하록 2654     2009-08-06
ftpaccess(5) ftpaccess(5) 이름 ftpaccess - ftpd 설정 file 설명 ftpaccess file은 ftpd(1) 의 운영을 설정하는데 사용한다. 접근 방법 설정 autogroup <groupname> <class> [<class> ...] Anonymous user가 특정 <class>의 member일때, ftp server는 <group...  
162 미러링 스크립트... 하록 797     2009-07-09
#---------------------------------------------------------------- banner Config-BACKUP~ #cp /etc/vfstab /etc/vfstab.org ls /etc/vfstab* #cp /etc/system /etc/system.org ls /etc/system* #cp /etc/hosts /etc/hosts.org #cp /etc/path_to_inst /etc/...  
161 disksuite로 OS mirroring 되어있는데 복구하는 방법 하록 1349     2009-06-05
Q. SunFire 4800에서 D240장비의 36GB HDD 2개가 mirroring 구성이 되어있습니다. metastat로 확인해보면 c0t0d0 은 정상인데 c0t1d0은 disk가 fail이 난 것 같더군요... format으로 확인해보면 c0t1d0은 <unknown disk> 라고 표시됩니다. c0t1d0 disk를 mirro...  
160 DiskSuite 설치 및 OS 미러구성 하록 1288     2009-06-05
< Solstice Disksuite 4.2.1 를 Solaris 8 에 인스톨하기 > 1. Solaris 8 의 2/2 CD 를 넣습니다. # cd /cdrom/sol_8_1000_sparc_2/Solaris_8/EA/products/DiskSuite_4.2.1/sparc/Packages 2. SDS (Solstice Disksuite ) 패캐지 인스톨하기 # pkgadd -d . 3. P...  
159 solaris 10, software 미러링... 하록 1233     2009-06-05
첫뻔째 과제. 하드웨어적으로 RAID1 이 구성된 시스템을 허물고 software 적으로 동일한 움직임을 구현하는것. -> HDD0 , HDD1 이 동시에 읽고 쓰기가 이루어져 양 디스크가 완벽하게 동일한 구조로 작동. -> 한쪽 디스크의 손상시 다른 한쪽으로 완벽하게 가...  
158 IPMP: IP Multipathing 설정방법 하록 1575     2009-06-04
IPMP: IP Multipathing Filed under: networks — by Kwanghoon Jhin at 15:31 +0900 네트워크에 대한 안정성은 이제, 데이터 만큼이나 중요해 졌습니다. 사실, 시스템에서 운영되어 그 안정성이 절하되는 부분은 없다고 할 수 있습니다. 모든 시스템은 이제 안...  
157 단말기 폭 초과 메세지 발생시... 하록 1029     2009-05-28
stty columns 160  
156 StorEdge 체크 명령어 하록 1720     2009-03-09
usage: sccli [options] device [command] Valid options: -d disk, --disk=cXtYdZ select LVD single-bus JBOD enclosure containing specified disk -h, --help, --usage display valid commands -l, --list display a list of local StorEdge 3000 devices ...  
155 PROXY 서버 SQUID 설치 하록 991     2008-11-14
프록시 서버는 네트워크속도가 느린 환경에서 보다 빠른 인터넷을 사용하기 위해 서버에 캐시서버를 만들어 자주가는 사이트를 저장하여 접속할때 속도를 빠르게 하기위해 쓰인다. 또한 클라이언트의 접속통제 등의 네트워크보안을 유지할때도 쓰인다. 1) 다운...  
154 Network Interface Device Name [1] 하록 2678     2008-11-14
Network Interface Device dnet DEC 21040/21140 Ethernet, DEC 21142/21143 Fast Ethernet, SMC9332BDT Fast Ethernet, Cogent EM110TX Fast Ethernet, Cogent EM440 Fast Ethernet e1000g Intel(R) PRO/1000 Server Adapter elx 3C590, 3C595, 3C5×9, 3C5×9B...  
153 System Time 오작동 시... 하록 1343     2008-09-19
우선 이문제는 ScApp 5.18.X, 5.19.X와 5.20.X 일때, SC의 uptime이 575일 이상이면 발생 할 수 있는 문제입니다. 두가지 조건이 모두 만족해야하는거고 조치 방법은 5.20.7이상으로 ScApp를 upgrade하는 것입니다. 또한 4800뿐 아니라 다음의 서버군에 해당하...  
152 소스로 APM 설치 하록 965     2008-05-27
소스로 APM 설치 1. 소스 받기 아파치 : http://httpd.apache.org/download.cgi Mysql : wget http://dev.mysql.com/get/Downloads/MySQL-4.0/mysql-standard-4.0.23-pc-linux-i686.tar.gz/from/http://mysql.new21.com/ (4.1버전도 있지만 제로 보드와 연동 ...