http://www.databaser.net/solaris/solaris_performence.htm
성능 측정...
일단 시스템 관리자라면 시스템의 성능에 신경쓰지 않을 수 없습니다...
물론..보안등등의 관리도 해줘야 겠지만요...헐헐~
그러나 시스템을 평가한다면...거의 두가지 측면에서 바라보게 됩니다...
안정성과 성능...
이 두가지중 여기서 살펴볼것은 성능측정입니다..
시스템 관리자는 다음과 같은 사항들을 중점적으로 검토해야 합니다..
- cpu 사용량
- 버퍼의 사용량
- 디스크와 백업의 i/o의 액티비티
- 터미널 디바이스의 액티비티
- 시스템 콜의 액티비티
- context switching
- file access
- queue activity
- kernel table
- interprocess communication
- 페이징
- free memory and swap sapce
- KMA(Kernel Memory Allocation)
- RFS(Remote File Sharing)
관리자는 이러한 사항들을 cron(일정주기로 작업을 명령)을 이용해서 주기적으로 
측정/검토하여 그 리포트를 작성하도록 해야합니다..
그러면 성능측정에 대한 명령어를 하나씩 살펴보기로 하겠습니다..
양이 좀 많네여..헐헐~
일단 전에도 나온 ps(프로세스 상태 측정) 명령어를 다시한번 살펴봅시다..
보통의 사용에서 -l 옵션만 주면 프로세스의 자세한 사항을 나열해 줍니다..
각 필드의 의미는 다음과 같습니다..
 
F    : 프로세스 플래그
S    : 프로세스의 상태
       O : 실행중인 프로세스
       S : Sleeping 상태의 프로세스
       R : Run Queue 에 있는 프로세스
       Z : Zombie 상태의 프로세스
       T : Job control signal에 의해 정지된 프로세스
UID   : 프로세스 소유자인 user ID 수
PID   : 프로세스 ID
PPID  : 부모프로세스 ID
C     : 스케줄링을 위한 프로세스 사용량
CLS   : 스케줄링 클래스
PRI   : 프로세스의 우선순위
NI    : 프로세스의 우선 순위 사용된 값
ADDR  : 프로세스의 메모리 주소
SZ    : 가상 메모리에서 프로세스의 전체 크기, 데이타와 스택 세그먼트 크기
WCHAN : Sleeping 상태에 있는 프로세스의 이벤트 주소
STIME : 프로세스의 시작시간
TTY   : 프로세스의 실행 터미널
TIME  : 프로세스의 실행 누적시간
COMMAND : 명령어
또 -o 옵션을 사용하면 사용자가 특정 포멧을 정의하여 모든 프로세스의 상태를 점검함으로써
각각의 프로세스가 사용하고 있는 시스템 리소스등을 측정할 수 있습니다...
각 필드의 의미는 다음과 같습니다..
위에서 나온 필드는 생략하겠습니다..

user   : 프로세스 사용상의 user ID
ruser  : 프로세스 실질적인 user ID
group  : 프로세스 사용상의 group ID
rgroup : 프로세스 실질적인 group ID
pid  
ppid
pgid   : 프로세스의 group ID
pcpu   : 같은 시간대에 CPU 사용시간에 대한 비율(%)
vsz    : 가상메모리에서 프로세스 전체 크기
nice   : 프로세스의 시스템 스케줄링에 대한 우선순위에 대한 십진수값
dd     : 요일
hh     : 시간
mm     : 분
ss     : 초
tty
comm
args   : 모든 아규먼트를 포함하고 있는 명령어
======================================================================
# ps -l
 F S   UID   PID  PPID  C PRI NI     ADDR     SZ    WCHAN TTY      TIME CMD
 8 S     0  9421  9415  0  51 20 e173e0e0     61 e173e14c pts/4    0:00 sh
 8 O     0  9422  9421  0  51 20 e16717f8    354          pts/4    0:00 ps
# ps -efl | more
 F S      UID   PID  PPID  C PRI NI     ADDR     SZ    WCHAN    STIME TTY      TIME CMD
19 T     root     0     0  0   0 SY fec16d9c      0           11월 26 ?        0:03 sched
 8 S     root     1     0  0  40 20 e0e1a750    162 e0e1a97c  11월 26 ?        0:01 /etc/init -
19 S     root     2     0  0   0 SY e0e1a008      0 fec397bc  11월 26 ?        0:01 pageout
19 S     root     3     0  0   0 SY e0e14758      0 feca0564  11월 26 ?       28:41 fsflush
 8 S     root   323     1  0  40 20 e0e14010    359 e0e0dc9c  11월 26 ?        0:00 /usr/lib/saf/sac -t 300
 8 S     root   268   267  0  44 20 e0e72760    627 e128972c  11월 26 ?        0:00 htt_server -port 9010 -syslog -mess
 8 S     root   154     1  0  41 20 e0e72018    540 e0f12782  11월 26 ?        0:00 /usr/sbin/rpcbind
 8 S     root    63     1  0  57 20 e0f48768    322 e0f48994  11월 26 ?        0:00 /usr/lib/sysevent/syseventd
 8 S     root    65     1  0  57 20 e0f48020    270  8062f54  11월 26 ?        0:00 /usr/lib/sysevent/syseventconfd
 8 S     root   223     1  0  44 20 e10f9770    733 e10f999c  11월 26 ?        0:02 /usr/sbin/nscd
 8 S     root   140     1  0  40 20 e10f9028    395 e0f127c2  11월 26 ?        0:00 /usr/lib/inet/in.ndpd
 8 S     root   206     1  0  47 20 e10f6778    763 e0f12482  11월 26 ?        0:00 /usr/sbin/syslogd
 8 S     root   197     1  0  41 20 e10f6030    642  807fd1c  11월 26 ?        0:00 /usr/lib/autofs/automountd
                            
                                  .
                                  .
                                  .
                                  .
                                  .
                                  .
                                  .
 # ps -ef -o 'user group pid ppid pcpu pmem vsz rss time stime tty args' | more
    USER    GROUP   PID  PPID %CPU %MEM  VSZ  RSS        TIME    STIME TT      COMMAND
    root     root     0     0  0.0  0.0    0    0        0:03  11월_26 ?       sched
    root     root     1     0  0.0  0.1  648  116        0:01  11월_26 ?       /etc/init -
    root     root     2     0  0.0  0.0    0    0        0:01  11월_26 ?       pageout
    root     root     3     0  0.1  0.0    0    0       28:41  11월_26 ?       fsflush
    root     root   323     1  0.0  0.2 1436  140        0:00  11월_26 ?       /usr/lib/saf/sac -t 300
                                   .
                                   .
                                   .
                                   .
                                   .
                                   .                            
======================================================================
다음은 vmstat 명령에 대해서 살펴봅니다...
이 명령어는 프로세스, 가상 메모리, 페이징, 디스크, CPU 등의 상태를 측정할 수 있습니다..
멀티프로세스인 경우는 모든 프로세서 사용량의 평균값으로 나타냅니다..
옵션은 다음과 같습니다..
c : cache flushing 통계치
i : 디바이스당 인터럽트 수
s : 부팅 이후부터 시스템에서 발생된 전체 이벤트
S : 페이징 대신에 스와핑을 표시. 페이징의 re와 mf를 스와핑 출력의 입/출력으로 나타낸다.

각 필드를 살펴보겠습니다...
procs: 프로세스의 수와 그에 해당하는 데이타를 나타낸다.
  - r : 실행 가능한 상태로 대기 큐에 쌓인 프로세스의 수. 숫자가 크면 프로세스의 사용이 원할치 못한 것을 의미.
        이 수치가 3 이상을 넘어 같다면 CPU는 바쁜 것으로 보면 된다..
  - b : 입/출력 자원을 할당받지 못해 블록된 프로세스
  - w : swap-out된 프로세스수. 실행 가능한 대기 큐에는 쌓이지 않고
      swap-out된 프로세스가 많다는 것은 physical memory가 부족하다는 뜻
memory : 가상메모리와 Phygical 메모리의 사용량.. 
         free메모리가 인스톨된 메모리의 6% 보다 계속적으로 작으면 가용 메모리가 부족한 경우이고,
         잠재적인 병목현상
page : 초 당 발생하는 fault page 수와 실행중인 페이징 표시
  - re : page reclaim
  - mf : minor fault
  - pi : page in(KB)
  - po : page out(KB)
  - fr : free(KB)
  - de : short-term 메모리 부족분, 즉, swap-in을 막기 위해서 swap-out시에 설정된 인공적인 메모리의 부족분이다.
  - sr : clock 알고리즘에 의한 페이지 scanned. sr 은 가용 메모리 부족시에 활성화도니 페이지 데몬의 수를 나타낸다.
         즉, sr 이 크다는 것은 사용 가능 메모리가 부족하다는 것이다. 이 수치가 약 300 이상을 넘어 갈때는 사용가능 메모리 부족상태
disk : 초당 디스크 조작수
faults : 초당 trap/interrupt 비율
  - in : device interrupt(non clock)
  - sy : 초당 system fault
  - cs : CPU context switch 율
CPU : CPU 사용시간에 대한 백분율(%)
 - us : 사용자 사용 시간
 - sy : 시스템 사용 시간
 - id : idel time      
         
=======================================================================
# vmstat 3                               -- 3초주기로 시스템의 성능측정
 procs     memory            page            disk          faults      cpu
 r b w   swap  free  re  mf pi po fr de sr cd f0 s0 --   in   sy   cs us sy id
 0 0 0 402156 24052   0   2  1  1  1  0  0  2  0  0  0  124  124  233  0  1 99
 0 0 0 326372  2764   0   2  2  0  0  0  0  1  0  0  0  139  100  232  0  0 100
 0 0 0 326372  2764   0   0  0  0  0  0  0  1  0  0  0  137   99  229  0  0 100
# vmstat -s                            -- 시스템이 부팅한 이후 지금까지 발생한 모든 이벤트를 나타낸다.
        0 swap ins
        0 swap outs
        0 pages swapped in
        0 pages swapped out
  1338611 total address trans. faults taken
    79572 page ins
    94967 page outs
   264645 pages paged in
   235797 pages paged out
   522758 total reclaims
   522751 reclaims from free list
        0 micro (hat) faults
  1338611 minor (as) faults
    66710 major faults
   275034 copy-on-write faults
   269827 zero fill page faults
   207534 pages examined by the clock daemon
        7 revolutions of the clock hand
   258255 pages freed by the clock daemon
     8612 forks
      817 vforks
     7357 execs
131379033 cpu context switches
126398988 device interrupts
  1806843 traps
 70023420 system calls
  3482588 total name lookups (cache hits 97%)
    44446 user   cpu
   339472 system cpu
 55847698 idle   cpu
    78465 wait   cpu
# vmstat -S 3                                  
-- 페이징에 대한 내용...si/so가 추가됨...(si: 초당 swap-in수, so: swap-out된 전체 프로세스 수)
 procs     memory            page            disk          faults      cpu
 r b w   swap  free  si  so pi po fr de sr cd f0 s0 --   in   sy   cs us sy id
 0 0 0 402040 24016   0   0  1  1  1  0  0  2  0  0  0  124  124  233  0  1 99
 0 0 0 326340  2692   0   0  0  8  8  0  0  1  0  0  0  134   97  230  0  0 100
 0 0 0 326340  2692   0   0  0  8  8  0  0  1  0  0  0  133   99  229  0  0 100
# vmstat -i
interrupt         total     rate
--------------------------------
clock          56339497      100
fdc0                 55        0
--------------------------------
Total          56339552      100
    
=======================================================================
다음은 디스크와 관련된 성능측정의 명령어와 방법을 살펴보겠습니다...
iostat는 각 디스크에서 받는 로드를 측정할 수 있는 명령어 입니다..
옵션은 다음과 같습니다..
c : user mode, system mode, I/O를 위한 waiting, idle 등에 사용된 사용 시간에 대한 백분율
D : 초당 디스크의 read, write와 utilzation에 대한 백분율
t : 초당 터미널에서 사용된 read, write의 character 수
x : 추가된 모든 디스크들의 상태 표시
다음은 각 필드의 의미 입니다..
tin  : 터미널 입력큐의 문자수
tout : 터미널 출력큐의 문자수
bps  : 초당 블록
tps  : 초당 트랜잭션
serv : 서비스 시간의 평균값(단위:ms)
us   : 사용자 모드
sy   : 시스템 모드
wr   : 입출력 wating
id   : idle
r/s  : 초당 읽기수
w/s  : 초당 쓰기수
kr/s : 초당 읽기수(KB)
kw/s : 초당 쓰기수(KB)
wait : 서비스를 위한 트랜잭션 waiting 평균값
actv : 실질적으로 서비스된 트랜잭션의 평균값
svc_t: 서비스 시간 평균값(단위: ms)
%w   : 큐가 비어있지 않는 시간의 백분율
%b   : 디스크가 busy 상태인 시간의 백분율
=======================================================================
# iostat 3
   tty       cmdk0          sd0           nfs1          nfs2           cpu
 tin tout kps tps serv  kps tps serv  kps tps serv  kps tps serv   us sy wt id
   0    7  14   2   40    0   0    7    0   0    1    0   0    0    0  1  0 99
   0   78   8   1    2    0   0    0    0   0    0    0   0    0    0  0  0 100
   0   27   8   1    2    0   0    0    0   0    0    0   0    0    0  1  0 99
# iostat -xtc 3                                                                       
--  30간의 평균 사용량이 30%를 넘는 디스크 서비스 시간은 점검할 필요가 있다.
                  extended device statistics                      tty         cpu
device       r/s    w/s   kr/s   kw/s wait actv  svc_t  %w  %b  tin tout  us sy wt id
cmdk0        0.2    1.4    2.5   11.4  0.1  0.0   39.5   0   1    0    7   0  1  0 99
fd0          0.0    0.0    0.0    0.0  0.0  0.0   95.7   0   0
sd0          0.0    0.0    0.0    0.0  0.0  0.0    7.0   0   0
nfs1         0.0    0.0    0.0    0.0  0.0  0.0    0.7   0   0
nfs2         0.0    0.0    0.0    0.0  0.0  0.0    0.0   0   0
                  extended device statistics                      tty         cpu
device       r/s    w/s   kr/s   kw/s wait actv  svc_t  %w  %b  tin tout  us sy wt id
cmdk0        0.0    1.0    0.0    8.0  0.0  0.0    2.4   0   0    0  172   0  0  0 100
fd0          0.0    0.0    0.0    0.0  0.0  0.0    0.0   0   0
sd0          0.0    0.0    0.0    0.0  0.0  0.0    0.0   0   0
nfs1         0.0    0.0    0.0    0.0  0.0  0.0    0.0   0   0
nfs2         0.0    0.0    0.0    0.0  0.0  0.0    0.0   0   0
# iostat -D 3                                                                   
-- 시스템의 디스크 입출력이 가장 활발할때 측정...util이 65% 이상이면 과부하로 판단할 수 있다.
   cmdk0          sd0           nfs1          nfs2
rps wps util  rps wps util  rps wps util  rps wps util
  0   1  0.6    0   0  0.0    0   0  0.0    0   0  0.0
  1   1  1.4    0   0  0.0    0   0  0.0    0   0  0.0
  0   1  0.2    0   0  0.0    0   0  0.0    0   0  0.0
 
=======================================================================
다음은 시스템의 여러 리소스들의 성능을 측정할 수 있는 명령어로 
sar(System Activity Reporter)를 알아보겠습니다..
이 명령어를 사용하면 운영중인 상태에서 자동으로 데이타를 수집할 수 있으며, 특정 파일을 사용하여 일정한 주기에
의해 데이타를 파일로 정리할 수 있습니다..
첫번째 포멧
t초의 간격을 주기로 하여 n번 반복적으로 실행.
-o 옵션으로 특정파일에 저장할 수 있다. 바이너리 형태로 저장
두번째 포멧
주로 전에 이미 sar명령을 통해 기록해 두었던 파일이 존재할 경우에 이 포멧을 사용
-f 옵션을 사용하여 불러올 파일을 정의한다.
-s, -e 옵션을 사용하여 시작과 끝나는 시간을 정의할 수 있다.
-i 옵션은 일정한 주기(초)를 나타낸다.
옵션 
-a : Check file access operation
-b : Report buffer activity
-c : Report system calls
-d : Report block device activity
-g : Report paging activity( page-out & memory freeing)
-k : Report kernel memory allocation(KMA) activity
-m : Report message & semaphore acitivity
-p : Report pagin acitivity(page-in & fault activity)
-q : Report average queue length while occupied & percent of time occupied
-r : Report unused memory pages & disk blocks
-u : Report CPU utilization
-v : Report status of process. i-node, file tables
-x : Report remote file-shring activity
-w : Report system swapping & switching activity
-y : Report TTY device activity
-A : Report all data
참고: 특정옵션을 주지 않으면 기본 옵션이 -u
================================================================================
# sar 3 5                                                 -- 3초 간격으로 5회 실행
SunOS yasicom 5.8 Generic_108529-09 i86pc    12/03/01
01:23:35    %usr    %sys    %wio   %idle
01:23:38       0       0       0     100
01:23:41       0       0       0     100
01:23:44       0       1       0      99
01:23:47       0       0       0     100
01:23:50       0       0       0     100
Average        0       0       0     100
# sar 3 5                                    -- 특정 옵션 없이 cpu 점검
SunOS yasicom 5.8 Generic_108529-09 i86pc    12/03/01
01:23:35    %usr    %sys    %wio   %idle
01:23:38       0       0       0     100
01:23:41       0       0       0     100
01:23:44       0       1       0      99
01:23:47       0       0       0     100
01:23:50       0       0       0     100
Average        0       0       0     100
# sar -o /tmp/sar_1.file 3 5
SunOS yasicom 5.8 Generic_108529-09 i86pc    12/03/01
01:24:50    %usr    %sys    %wio   %idle
01:24:53       0       2       0      98
01:24:56       0       0       0     100
01:24:59       0       0       0     100
01:25:02       0       0       0     100
01:25:05       0       0       0     100
Average        0       0       0     100
# ls -l /tmp/sar_1.file
-rw-r--r--   1 root     other      17640 12월  3일  01:25 /tmp/sar_1.file
# sar -f /tmp/sar_1.file
SunOS yasicom 5.8 Generic_108529-09 i86pc    12/03/01
01:24:50    %usr    %sys    %wio   %idle
01:24:53       0       2       0      98
01:24:56       0       0       0     100
01:24:59       0       0       0     100
01:25:02       0       0       0     100
01:25:05       0       0       0     100
Average        0       0       0     100
# sar -b 3 5                                      -- 버퍼의 activity 점검
SunOS yasicom 5.8 Generic_108529-09 i86pc    12/03/01
01:26:14 bread/s lread/s %rcache bwrit/s lwrit/s %wcache pread/s pwrit/s                
01:26:17       0       0     100       0       0     100       0       0
01:26:20       0       0     100       0       0     100       0       0
01:26:23       0       5     100       4       9      58       0       0
01:26:26       0       1     100       1       1       0       0       0
01:26:29       0       0     100       0       0     100       0       0
Average        0       1     100       1       2      52       0       0             
-- %rcache와 %wcache는 시스템 버퍼의 유효값
-- %rcache가 90 이하로 떨어지거나, %wcache가 65 이하로 측정되면 버퍼 스페이스를 증가시켜서 성능 증가시킴
#
#
#
# sar -d 10 3                                                
-- 디스크 입출력 점검...10초간격으로 3번
SunOS yasicom 5.8 Generic_108529-09 i86pc    12/03/01
01:28:21   device        %busy   avque   r+w/s  blks/s  avwait  avserv
01:28:31   cmdk0             0     0.0       2      26     0.0     2.4
           fd0               0     0.0       0       0     0.0     0.0
           nfs1              0     0.0       0       0     0.0     0.0
           nfs2              0     0.0       0       0     0.0     0.0
           sd0               0     0.0       0       0     0.0     0.0
           uhci0,bu          0     0.0       0       0     0.0     0.0
           uhci0,ct          0     0.0       0       0     0.0     0.0
           uhci0,in          0     0.0       0       0     0.0     0.0
           uhci0,is          0     0.0       0       0     0.0     0.0
           uhci0,to          0     0.0       0       0     0.0     0.0
01:28:41   cmdk0             0     0.0       1      14     0.0     2.4
           fd0               0     0.0       0       0     0.0     0.0
           nfs1              0     0.0       0       0     0.0     0.0
           nfs2              0     0.0       0       0     0.0     0.0
           sd0               0     0.0       0       0     0.0     0.0
           uhci0,bu          0     0.0       0       0     0.0     0.0
           uhci0,ct          0     0.0       0       0     0.0     0.0
           uhci0,in          0     0.0       0       0     0.0     0.0
           uhci0,is          0     0.0       0       0     0.0     0.0
           uhci0,to          0     0.0       0       0     0.0     0.0
01:28:51   cmdk0             0     0.0       1      14     0.0     2.4
           fd0               0     0.0       0       0     0.0     0.0
           nfs1              0     0.0       0       0     0.0     0.0
           nfs2              0     0.0       0       0     0.0     0.0
           sd0               0     0.0       0       0     0.0     0.0
           uhci0,bu          0     0.0       0       0     0.0     0.0
           uhci0,ct          0     0.0       0       0     0.0     0.0
           uhci0,in          0     0.0       0       0     0.0     0.0
           uhci0,is          0     0.0       0       0     0.0     0.0
           uhci0,to          0     0.0       0       0     0.0     0.0

Average    cmdk0             0     0.0       1      18     0.0     2.4
           fd0               0     0.0       0       0     0.0     0.0
           nfs1              0     0.0       0       0     0.0     0.0
           nfs2              0     0.0       0       0     0.0     0.0
           sd0               0     0.0       0       0     0.0     0.0
           uhci0,bu          0     0.0       0       0     0.0     0.0
           uhci0,ct          0     0.0       0       0     0.0     0.0
           uhci0,in          0     0.0       0       0     0.0     0.0
           uhci0,is          0     0.0       0       0     0.0     0.0
           uhci0,to          0     0.0       0       0     0.0     0.0
# sar -g 10 3                                                           -- 메모리와 page-in 점검...
SunOS yasicom 5.8 Generic_108529-09 i86pc    12/03/01
01:29:54  pgout/s ppgout/s pgfree/s pgscan/s %ufs_ipf                    
-- pgscan/s는 초당 페이지수인데...이 값이 높으면 가용 메모리 부족한 상태
01:30:04     0.90     1.80     1.80     0.00     0.00
01:30:14     0.90     1.80     1.80     0.00     0.00
01:30:24     0.90     1.80     1.80     0.00     0.00
Average      0.90     1.80     1.80     0.00     0.00
#
#
#
-- runq-sz는 메모리 상에서 대기중인 프로세스 쓰레드 수를 나타내며, 계속해서 2 이상을 나타내면 cpu가 한계치에 다다른 것으로 판단
-- %runocc는 어떤 run queue가 할당되었는지 나타낸 것으로 숫자가 적을 수록 우선 순위가 높다
# sar -r 10 3        -- 프로세스 점검         
SunOS yasicom 5.8 Generic_108529-09 i86pc    12/03/01
01:31:57 freemem freeswap
01:32:07     608   652136
01:32:17     606   652136
01:32:27     606   652136
Average      607   652136
# sar -r 10 3                              -- 가용 메모리와 swa3-file disk block
SunOS yasicom 5.8 Generic_108529-09 i86pc    12/03/01
01:34:32 freemem freeswap
01:34:42     610   652136
01:34:52     621   652136
01:35:02     622   652131
Average      617   652134                      
-- 가용 메모리가 인스톨된 메모리의 6% 보다 계속해서 작으면 가용 메모리가 부족한 경우로 잠재적인 병목현상
=============================================================================================
다음은 네트웍에 관련된 성능 측정입니다...
두가지 명령어를 살펴보겠습니다...
먼저 각 네트웍 인터페이스의 전송 상태를 알 수 있는 명령어로 netstat 명령이 있습니다..
옵션으로 -i 를 사용하면 tcp/ip 트래픽에 있어서 각 인터페이스의 패킷 사용량 상태를 확인 할 수 있습니다..
아래를 실행한 것을 보면..
Collision Rate = collis/opkts = 0/675407 = 0
이 수치가 5% ~ 10%에 가까워지면 네트웍에 오버로드가 초래된 것이라고 볼 수 있습니다..
Input packet Error Rate = ierrs/Ipkts
Ouput Packet Error Rate = Oerrs/Opkts
Input Packet Error Rate가 0.25% 보다 크게되면 시스템은 패킷을 드롭하게 됩니다..
=============================================================================
# netstat -i 5
    input   elxl0     output           input  (Total)    output
packets errs  packets errs  colls  packets errs  packets errs  colls
1553181 6     675370  0     0      2862401 6     1984590 0     0
11      0     1       0     0      21      0     11      0     0
10      0     2       0     0      20      0     12      0     0
10      0     2       0     0      20      0     12      0     0
12      0     2       0     0      22      0     12      0     0
10      0     2       0     0      22      0     14      0     0
10      0     2       0     0      20      0     12      0     0
9       0     2       0     0      19      0     12      0     0
7       0     2       0     0      17      0     12      0     0
10      0     3       0     0      20      0     13      0     0
8       0     2       0     0      16      0     10      0     0
                                 .
                                 .
                                 .
                                 .
                                 .
                                 .
# netstat -i
Name  Mtu  Net/Dest      Address        Ipkts  Ierrs Opkts  Oerrs Collis Queue
lo0   8232 loopback      localhost      1309340 0     1309340 0     0      0
elxl0 1500 192.168.0.0   yasicom        1553317 6     675407 0     0      0
Name  Mtu  Net/Dest                    Address                     Ipkts  Ierrs Opkts  Oerrs Collis
lo0   8252 localhost                   localhost                   1309340 0     1309340 0     0
elxl0 1500 fe80::201:2ff:fe7d:3cb4/10  fe80::201:2ff:fe7d:3cb4     1553320 6     675410 0     0
=============================================================================================
두번째 네트웍에 관련된 성능측정 명령어로 snoop이 있습니다..
이것은 네트웍에서 패킷을 캡처하는데 사용하며, 모든 각 클라이언트와 서버간의 coll trace를 담을 수 있습니다..
다음은 이 명령어를 이용해서 네트웍에 패킷을 특정 파일에 보관하고, 다시 그 파일에 저장된 내용을 확인하는 예입니다.
=============================================================================================
# snoop -o /tmp/a
Using device /dev/elxl (promiscuous mode)
20 ^C
# snoop -i /tmp/a
  1   0.00000  192.168.0.1 -> yasicom      TELNET C port=3565
  2   0.00023      yasicom -> 192.168.0.1  TELNET R port=3565 Using device /dev/el
  3   0.15040  192.168.0.1 -> 192.168.0.255 UDP D=39213 S=3516 LEN=832
  4   0.04999  192.168.0.1 -> yasicom      TELNET C port=3565
  5   0.79813      yasicom -> 192.168.0.1  TELNET R port=3565
  6   0.10485  192.168.0.1 -> yasicom      TELNET C port=3565
  7   0.00020      yasicom -> 192.168.0.1  TELNET R port=3565
  8   0.20046  192.168.0.1 -> yasicom      TELNET C port=3565
  9   0.06794  192.168.0.1 -> 192.168.0.255 UDP D=39213 S=3517 LEN=276
 10   0.00068  192.168.0.1 -> 192.168.0.255 UDP D=39213 S=3518 LEN=120
 11   0.62573      yasicom -> 192.168.0.1  TELNET R port=3565
 12   0.10825  192.168.0.1 -> yasicom      TELNET C port=3565
 13   0.00021      yasicom -> 192.168.0.1  TELNET R port=3565
 14   0.20042  192.168.0.1 -> yasicom      TELNET C port=3565
 15   0.69107      yasicom -> 192.168.0.1  TELNET R port=3565 \r\00011
 16   0.11157  192.168.0.1 -> yasicom      TELNET C port=3565
 17   0.00020      yasicom -> 192.168.0.1  TELNET R port=3565 \r\00012 \r\00013 \r\00014
 18   0.09619  192.168.0.1 -> 192.168.0.255 UDP D=39213 S=3519 LEN=832
 19   0.10424  192.168.0.1 -> yasicom      TELNET C port=3565
 20   0.50641  192.168.0.1 -> 192.168.0.255 UDP D=39213 S=3520 LEN=276
====================================================================
이제 툴하나만 소개하고...솔라리스에 대한 정리는 끝납니다..헐헐~
마지막으로 소개할 툴은 모냐면...
sdtprocess라는 툴입니다..이 툴은 CDE 환경에서 사용하는 성능 측정 툴입니다...
역쉬...GUI툴이기 때문에 마우스로 또각또각 찍어가면서 툴의 사용법을 익히시기 바랍니다..
글고....프리웨어로 웹에서 top 이란 툴을 제공하고 있습니다..
www.sunfreeware.com에 가시면...있습니다..
각자 OS 버전에 맞는 것으로 다운 받으셔서...pkgadd 하여 설치하시기 바랍니다...

Solaris7 에서 SSH(openssh) 설치

Posted 2009. 2. 17. 11:47


밑에 보시면 Solaris 8 에서 설치하는 글이 있는데 또 적는 이유는  Solaris 8에서 조금 더 수정 및 추가가 되어야 하는 부분이 있어서 이렇게 다시 적습니다. (2009.01.23)

환경 : Solaris7 SPARC


1. SSH 설치에 필요한 Package 다운로드

http://sunfreeware.com  에서 접속하여 오른쪽에 있는 Solaris7 x86, Solaris8 SPARC 중 해당 시스템 사항에 맞추어서 클릭하여  아래에 적힌 목록들을 다운

egd-0.8-sol7-sparc-local
gcc-3.4.6-sol7-sparc-local.gz
libgcc-3.4.6-sol7-sparc-local.gz
openssh-5.1p1-sol7-sparc-local.gz
openssl-0.9.8i-sol7-sparc-local.gz
perl-5.8.8-sol7-sparc-local
prngd-0.9.25-sol7-sparc-local.gz
tcp_wrappers-7.6-sol7-sparc-local.gz
zlib-1.2.3-sol7-sparc-local.gz

위에 리스트중에 이미 설치되어있는것은 생략하셔도 됩니다.
혹시 이 버젼보다 상위 버젼이 나왔다면 그것을 받아서 설치하셔도 됩니다.



2. Package 압축 해제 및 설치

위의 파일들은 모두 패키지 형식이기 때문에 gzip으로 압축만 풀고 간단한 명령어가 치면 자동으로

설치 됩니다.

예) #  gzip -d openssh-5.1p1-sol7-sparc-local.gz   

이렇게 모두 압축을 풀어주세요

압축을 풀게 되면 openssh-5.1p1-sol7-sparc-local 이렇게만 남습니다.


그다음 패키지를 풀면됩니다.


예) # pkgadd -d openssh-5.1p1-sol7-sparc-local

The following packages are available:
  1  SMCosh511     openssh
                   (sparc) 5.1p1

Select package(s) you wish to process (or 'all' to process
all packages). (default: all) [?,??,q]: all

Processing package instance <SMCosh511> from </home/kuma/openssh-5.1p1-sol7-sparc-local>

openssh
(sparc) 5.1p1
The OpenSSH Group
Using </usr/local> as the package base directory.
## Processing package information.
## Processing system information.
   6 package pathnames are already properly installed.
## Verifying disk space requirements.
## Checking for conflicts with packages already installed.
## Checking for setuid/setgid programs.

Installing openssh as <SMCosh511>

## Installing part 1 of 1.
/usr/local/bin/scp
/usr/local/bin/sftp
/usr/local/bin/slogin <symbolic link>
/usr/local/bin/ssh
/usr/local/bin/ssh-add
/usr/local/bin/ssh-agent
/usr/local/bin/ssh-keygen
/usr/local/bin/ssh-keyscan
/usr/local/doc/openssh/CREDITS
/usr/local/doc/openssh/ChangeLog
/usr/local/doc/openssh/INSTALL
/usr/local/doc/openssh/LICENCE
/usr/local/doc/openssh/OVERVIEW
/usr/local/doc/openssh/README
/usr/local/doc/openssh/README.dns
/usr/local/doc/openssh/README.platform
/usr/local/doc/openssh/README.privsep
/usr/local/doc/openssh/README.smartcard
/usr/local/doc/openssh/README.tun
/usr/local/doc/openssh/TODO
/usr/local/doc/openssh/WARNING.RNG
/usr/local/doc/openssh/contrib/Makefile
/usr/local/doc/openssh/contrib/README
/usr/local/doc/openssh/contrib/aix/README
/usr/local/doc/openssh/contrib/aix/buildbff.sh
/usr/local/doc/openssh/contrib/aix/inventory.sh
/usr/local/doc/openssh/contrib/aix/pam.conf
/usr/local/doc/openssh/contrib/caldera/openssh.spec
/usr/local/doc/openssh/contrib/caldera/ssh-host-keygen
/usr/local/doc/openssh/contrib/caldera/sshd.init
/usr/local/doc/openssh/contrib/caldera/sshd.pam
/usr/local/doc/openssh/contrib/cygwin/Makefile
/usr/local/doc/openssh/contrib/cygwin/README
/usr/local/doc/openssh/contrib/cygwin/ssh-host-config
/usr/local/doc/openssh/contrib/cygwin/ssh-user-config
/usr/local/doc/openssh/contrib/cygwin/sshd-inetd
/usr/local/doc/openssh/contrib/findssl.sh
/usr/local/doc/openssh/contrib/gnome-ssh-askpass1.c
/usr/local/doc/openssh/contrib/gnome-ssh-askpass2.c
/usr/local/doc/openssh/contrib/hpux/README
/usr/local/doc/openssh/contrib/hpux/egd
/usr/local/doc/openssh/contrib/hpux/egd.rc
/usr/local/doc/openssh/contrib/hpux/sshd
/usr/local/doc/openssh/contrib/hpux/sshd.rc
/usr/local/doc/openssh/contrib/redhat/gnome-ssh-askpass.csh
/usr/local/doc/openssh/contrib/redhat/gnome-ssh-askpass.sh
/usr/local/doc/openssh/contrib/redhat/openssh.spec
/usr/local/doc/openssh/contrib/redhat/sshd.init
/usr/local/doc/openssh/contrib/redhat/sshd.init.old
/usr/local/doc/openssh/contrib/redhat/sshd.pam
/usr/local/doc/openssh/contrib/redhat/sshd.pam.old
/usr/local/doc/openssh/contrib/solaris/README
/usr/local/doc/openssh/contrib/ssh-copy-id
/usr/local/doc/openssh/contrib/ssh-copy-id.1
/usr/local/doc/openssh/contrib/sshd.pam.freebsd
/usr/local/doc/openssh/contrib/sshd.pam.generic
/usr/local/doc/openssh/contrib/suse/openssh.spec
/usr/local/doc/openssh/contrib/suse/rc.config.sshd
/usr/local/doc/openssh/contrib/suse/rc.sshd
/usr/local/doc/openssh/contrib/suse/sysconfig.ssh
/usr/local/etc/moduli
/usr/local/etc/ssh_config
/usr/local/etc/sshd_config
/usr/local/libexec/sftp-server
/usr/local/libexec/ssh-keysign
/usr/local/libexec/ssh-rand-helper
/usr/local/sbin/sshd
/usr/local/share/Ssh.bin
/usr/local/share/man/man1/scp.1
/usr/local/share/man/man1/sftp.1
/usr/local/share/man/man1/slogin.1 <symbolic link>
/usr/local/share/man/man1/ssh-add.1
/usr/local/share/man/man1/ssh-agent.1
/usr/local/share/man/man1/ssh-keygen.1
/usr/local/share/man/man1/ssh-keyscan.1
/usr/local/share/man/man1/ssh.1
/usr/local/share/man/man5/ssh_config.5
/usr/local/share/man/man5/sshd_config.5
/usr/local/share/man/man8/sftp-server.8
/usr/local/share/man/man8/ssh-keysign.8
/usr/local/share/man/man8/ssh-rand-helper.8
/usr/local/share/man/man8/sshd.8
[ verifying class <none> ]

Installation of <SMCosh511> was successful.
#

이렇게 위의 리스트에 적혀있는 파일들을 예)를 보시고 설치 하시면 됩니다.



3. SSH 접속 환경 구성

# mkdir /var/empty 

# chown root:sys /var/empty
소유자와 그룹을 root:sys로 변경

# chmod 755 /var/empty
empty 사용 권한은 755(rwxr-xr-x)

# groupadd sshd
그룹 sshd 만들기

# useradd -g sshd -c 'sshd privsep' -d /var/empty -s /bin/false sshd



4. Getting Entropy (Solaris 8버젼 이상에서는 필요가 없는 부분입니다.)

만약 이부분을 하지않고 진행할 경우 ssh-keygen  명령어 사용시 에러가 발생하게 됩니다.

# ssh-keygen -t rsa1 -f /usr/local/etc/ssh_host_key -N ""
PRNG is not seeded

여기 진행부분은 필히 순서를 지켜서 사용하셔야 합니다.

먼저 /var/log or /var/adm 로 이동하세요

# cd /var/log
# cat syslog > /usr/local/etc/prngd/prngd-seed

or

# cd /var/adm
# cat messages > /usr/local/etc/prngd/prngd-seed

# mkdir /var/spool/prngd

# /usr/local/sbin/prngd /var/spool/prngd/pool
이부분이 prngd 실행하는 부분입니다.

# ln -s /var/spool/prngd/pool /dev/egde-pool

그다음 /etc/init.d 디렉토리에서 prngd 파일을 하나 생성해야합니다.

# vi prngd  or   # cat >> prngd

#!/bin/sh

pid=`/usr/bin/ps -e | /usr/bin/grep prngd | /usr/bin/sed -e 's/^  *//' -e 's/ .*//'`
case $1 in
'start')
 /usr/local/sbin/prngd /var/spool/prngd/pool
 ;;
'stop')
 if [ "${pid}" != "" ]
 then
  /usr/bin/kill ${pid}
 fi
 ;;
*)
 echo "usage: /etc/init.d/prngd {start|stop}"
 ;;
esac

이 파일은 제가 첨부파일로 올려놓겠습니다.




# chown root:sys /etc/init.d/prngd
prngd 파일의 소유자 및 그룹을  root:sys 로 변경

# chmod 755 /etc/init.d/prngd
prngd 파일의 권한을 755 (r-xr-xr-x)

# ln -s /etc/init.d/prngd /etc/rc2.d/S99prngd

이렇게 하시면 Server Reboot 데몬이 자동 실행되어 가동이 됩니다.




5. Tcp_Wrapper 설정

# vi /etc/hosts.allow
sshd : All    (추가)

# vi /etc/hosts.deny
Server로 접근 못하게 할 IP 등을 넣어시면 됩니다.

위 두부분은 파일만 만들어 놓고 나중에 추가 사항들을 추가 하시는게 좋을것 같습니다. 만약 원격으로 하실 경우 직접 서버가 있는 곳까지 가야할 상황이 생길 수 있으니까요.



6. SSH 사용을 위한 암호키 생성

먼저 PATH에 /usr/local/bin 과 /usr/local/sbin 이 등록되어 있어야 명령어를 실행하실 수 있습니다.

# ssh-keygen -t rsa1 -f /usr/local/etc/ssh_host_key -N ""
# ssh-keygen -t dsa -f /usr/local/etc/ssh_host_dsa_key -N ""
# ssh-keygen -t rsa -f /usr/local/etc/ssh_host_rsa_key -N ""

이렇게 하시면

예) # ssh-keygen -t rsa1 -f /usr/local/etc/ssh_host_key -N ""

Generating public/private rsa1 key pair.
Your identification has been saved in /usr/local/etc/ssh_host_key.
Your public key has been saved in /usr/local/etc/ssh_host_key.pub.
The key fingerprint is:
4f:00:d4:cc:c8:b2:7e:41:6e:3d:5d:c5:d0:52:17:cc root@unknown
The key's randomart image is:
+--[RSA1 2048]----+
|       oo=        .*=.o|
|        . +.+     o oE |
|               = ... . .  |
|            . + o.. .    |
|      .  .  .S..  ..     |
|    .    .  o          . |
|     .    .               |
|                          |
|                          |
+-----------------+
bash-2.03#

이런 형식의 내용을 화면에 뿌려줍니다.  만들어진 파일은 /usr/local/etc/ 안에 있습니다.



7. sshd Daemon Script 작성

# vi /etc/init.d/sshd

#!/bin/sh

pid=`/usr/bin/ps -e | /usr/bin/grep sshd | /usr/bin/sed -e 's/^  *//' -e 's/ .*//'`
case $1 in
'start')
/usr/local/sbin/sshd
;;
'stop')
if [ "${pid}" != "" ]
then
/usr/bin/kill ${pid}
fi
;;
*)
echo "usage: /etc/init.d/sshd {start|stop}"
;;
esac


혹은

case "$1" in

'start')
     # Start the ssh daemon
     if [ -f /usr/local/sbin/sshd ]; then
          echo "starting SSHD daemon"
          /usr/local/sbin/sshd &
     fi
     ;;

'stop')
     # Stop the ssh deamon
     PID=`/usr/bin/ps -e -u 0 | /usr/bin/fgrep sshd | /usr/bin/awk '{print $1}'`
     if [ ! -z "$PID" ] ; then
          /usr/bin/kill ${PID} >/dev/null 2>&1
     fi
     ;;

*)
     echo "usage: /etc/init.d/sshd {start|stop}"
     ;;

esac
exit 0

둘중에 하나를 작성하시면 됩니다.
제가 사용하는 파일을 첨부파일로 올리겠습니다.



# chown root:sys /etc/init.d/sshd
sshd 파일의 소유자 및 그룹을  root:sys 로 변경

# chmod 755 /etc/init.d/sshd
sshd 파일의 권한을 755 (r-xr-xr-x)

# cat >> /etc/rc2.d/S99sshd
/etc/init.d/sshd start
Ctrl + C <- 이거 아시죠? 빠져나오기.. ^^

# chome 744 /etc/rc2.d/S99sshd
sshd 파일의 권한을 744 (rwxr--r--)

이렇게 하시면 Server Reboot 데몬이 자동 실행되어 가동이 됩니다.



8. SSH, PRNGD 실행 및 가동여부 확인

# /etc/init.d/prngd start

# /etc/init.d/prngd stop

# ps -ef | grep prngd
    root 20381     1  0 16:18:33 ?        0:00 /usr/local/sbin/prngd /var/spool/prngd/pool

데몬이 제대로 올라오는지 확인.


# /etc/rc2.d/S99sshd
starting SSHD daemon

# ps -ef | grep sshd
    root   478     1  0 16:16:27 ?        0:02 /usr/local/sbin/sshd

이렇게 띄워져 있다면 실행되고 있습니다.

해 보시고 문제가 있다면 댓글을 남겨주세요~!

Solaris8 SSH 설치

Posted 2009. 2. 17. 11:38


현재 제가 설치하는 것을 토대로 해서 적겠습니다. (2008.11.27)

환경 : Solaris8 SPARC
          bash 쉘


1. SSH 설치에 필요한 Package 다운로드

http://sunfreeware.com  에서 접속하여 오른쪽에 있는 Solaris8 x86, Solaris8 SPARC 중 해당 시스템 사항에 맞추어서 클릭하여  아래에 적힌 목록들을 다운

gcc-3.4.6-sol8-sparc-local.gz
libgcc-3.4.6-sol8-sparc-local.gz
openssh-5.1p1-sol8-sparc-local.gz
openssl-0.9.8i-sol8-sparc-local.gz
prngd-0.9.25-sol8-sparc-local.gz
tcp_wrappers-7.6-sol8-sparc-local.gz
zlib-1.2.3-sol8-sparc-local.gz

위에 리스트중에 이미 설치되어있는것은 생략하셔도 됩니다.
혹시 이 버젼보다 상위 버젼이 나왔다면 그것을 받아서 설치하셔도 됩니다.



2. Package 압축 해제 및 설치

위의 파일들은 모두 패키지 형식이기 때문에 gzip으로 압축만 풀고 간단한 명령어가 치면 자동으로

설치 됩니다.

예) bash-2.03#  gzip -d openssh-5.1p1-sol8-sparc-local.gz   

아~ 위에서 bash-2.03#  이부분은 제가 bash 쉘 환경으로 작업하는거니 착오 없으시길 바랍니다.

이렇게 모두 압축을 풀어주세요

압축을 풀게 되면 openssh-5.1p1-sol8-sparc-local 이렇게만 남습니다.


그다음 패키지를 풀면됩니다.


예) bash-2.03# pkgadd -d openssh-5.1p1-sol8-sparc-local

The following packages are available:
  1  SMCosh511     openssh
                   (sparc) 5.1p1

Select package(s) you wish to process (or 'all' to process
all packages). (default: all) [?,??,q]: all

Processing package instance <SMCosh511> from </down/ssh/openssh-5.1p1-sol8-sparc-local>

openssh
(sparc) 5.1p1
The OpenSSH Group
Using </usr/local> as the package base directory.
## Processing package information.
## Processing system information.
   4 package pathnames are already properly installed.
## Verifying disk space requirements.
## Checking for conflicts with packages already installed.
## Checking for setuid/setgid programs.

Installing openssh as <SMCosh511>

## Installing part 1 of 1.
/usr/local/bin/scp
/usr/local/bin/sftp
/usr/local/bin/slogin <symbolic link>
/usr/local/bin/ssh
/usr/local/bin/ssh-add
/usr/local/bin/ssh-agent
/usr/local/bin/ssh-keygen
/usr/local/bin/ssh-keyscan
/usr/local/doc/openssh/CREDITS
/usr/local/doc/openssh/ChangeLog
/usr/local/doc/openssh/INSTALL
/usr/local/doc/openssh/LICENCE
/usr/local/doc/openssh/OVERVIEW
/usr/local/doc/openssh/README
/usr/local/doc/openssh/README.dns
/usr/local/doc/openssh/README.platform
/usr/local/doc/openssh/README.privsep
/usr/local/doc/openssh/README.smartcard
/usr/local/doc/openssh/README.tun
/usr/local/doc/openssh/TODO
/usr/local/doc/openssh/WARNING.RNG
/usr/local/doc/openssh/contrib/Makefile
/usr/local/doc/openssh/contrib/README
/usr/local/doc/openssh/contrib/aix/README
/usr/local/doc/openssh/contrib/aix/buildbff.sh
/usr/local/doc/openssh/contrib/aix/inventory.sh
/usr/local/doc/openssh/contrib/aix/pam.conf
/usr/local/doc/openssh/contrib/caldera/openssh.spec
/usr/local/doc/openssh/contrib/caldera/ssh-host-keygen
/usr/local/doc/openssh/contrib/caldera/sshd.init
/usr/local/doc/openssh/contrib/caldera/sshd.pam
/usr/local/doc/openssh/contrib/cygwin/Makefile
/usr/local/doc/openssh/contrib/cygwin/README
/usr/local/doc/openssh/contrib/cygwin/ssh-host-config
/usr/local/doc/openssh/contrib/cygwin/ssh-user-config
/usr/local/doc/openssh/contrib/cygwin/sshd-inetd
/usr/local/doc/openssh/contrib/findssl.sh
/usr/local/doc/openssh/contrib/gnome-ssh-askpass1.c
/usr/local/doc/openssh/contrib/gnome-ssh-askpass2.c
/usr/local/doc/openssh/contrib/hpux/README
/usr/local/doc/openssh/contrib/hpux/egd
/usr/local/doc/openssh/contrib/hpux/egd.rc
/usr/local/doc/openssh/contrib/hpux/sshd
/usr/local/doc/openssh/contrib/hpux/sshd.rc
/usr/local/doc/openssh/contrib/redhat/gnome-ssh-askpass.csh
/usr/local/doc/openssh/contrib/redhat/gnome-ssh-askpass.sh
/usr/local/doc/openssh/contrib/redhat/openssh.spec
/usr/local/doc/openssh/contrib/redhat/sshd.init
/usr/local/doc/openssh/contrib/redhat/sshd.init.old
/usr/local/doc/openssh/contrib/redhat/sshd.pam
/usr/local/doc/openssh/contrib/redhat/sshd.pam.old
/usr/local/doc/openssh/contrib/solaris/README
/usr/local/doc/openssh/contrib/ssh-copy-id
/usr/local/doc/openssh/contrib/ssh-copy-id.1
/usr/local/doc/openssh/contrib/sshd.pam.freebsd
/usr/local/doc/openssh/contrib/sshd.pam.generic
/usr/local/doc/openssh/contrib/suse/openssh.spec
/usr/local/doc/openssh/contrib/suse/rc.config.sshd
/usr/local/doc/openssh/contrib/suse/rc.sshd
/usr/local/doc/openssh/contrib/suse/sysconfig.ssh
/usr/local/etc/moduli
/usr/local/etc/ssh_config
/usr/local/etc/sshd_config
/usr/local/libexec/sftp-server
/usr/local/libexec/ssh-keysign
/usr/local/libexec/ssh-rand-helper
/usr/local/sbin/sshd
/usr/local/share/Ssh.bin
/usr/local/share/man/man1/scp.1
/usr/local/share/man/man1/sftp.1
/usr/local/share/man/man1/slogin.1 <symbolic link>
/usr/local/share/man/man1/ssh-add.1
/usr/local/share/man/man1/ssh-agent.1
/usr/local/share/man/man1/ssh-keygen.1
/usr/local/share/man/man1/ssh-keyscan.1
/usr/local/share/man/man1/ssh.1
/usr/local/share/man/man5/ssh_config.5
/usr/local/share/man/man5/sshd_config.5
/usr/local/share/man/man8/sftp-server.8
/usr/local/share/man/man8/ssh-keysign.8
/usr/local/share/man/man8/ssh-rand-helper.8
/usr/local/share/man/man8/sshd.8
[ verifying class <none> ]

Installation of <SMCosh511> was successful.

bash-2.03#

이렇게 위의 리스트에 적혀있는 파일들을 예)를 보시고 설치 하시면 됩니다.



3. SSH 접속 환경 구성

# mkdir /var/empty 

# chown root:sys /var/empty
소유자와 그룹을 root:sys로 변경

# chmod 755 /var/empty
empty 사용 권한은 755(rwxr-xr-x)

# groupadd sshd
그룹 sshd 만들기

# useradd -g sshd -c 'sshd privsep' -d /var/empty -s /bin/false sshd



4. Tcp_Wrapper 설정

# vi /etc/hosts.allow
sshd : All    (추가)

# vi /etc/hosts.deny
Server로 접근 못하게 할 IP 등을 넣어시면 됩니다.

위 두부분은 파일만 만들어 놓고 나중에 추가 사항들을 추가 하시는게 좋을것 같습니다. 만약 원격으로 하실 경우 직접 서버가 있는 곳까지 가야할 상황이 생길 수 있으니까요.



5. SSH 사용을 위한 암호키 생성

먼저 PATH에 /usr/local/bin 과 /usr/local/sbin 이 등록되어 있어야 명령어를 실행하실 수 있습니다.

# ssh-keygen -t rsa1 -f /usr/local/etc/ssh_host_key -N ""
# ssh-keygen -t dsa -f /usr/local/etc/ssh_host_dsa_key -N ""
# ssh-keygen -t rsa -f /usr/local/etc/ssh_host_rsa_key -N ""

이렇게 하시면

예) # ssh-keygen -t rsa1 -f /usr/local/etc/ssh_host_key -N ""

Generating public/private rsa1 key pair.
Your identification has been saved in /usr/local/etc/ssh_host_key.
Your public key has been saved in /usr/local/etc/ssh_host_key.pub.
The key fingerprint is:
4f:00:d4:cc:c8:b2:7e:41:6e:3d:5d:c5:d0:52:17:cc root@unknown
The key's randomart image is:
+--[RSA1 2048]----+
|       oo=        .*=.o|
|        . +.+     o oE |
|               = ... . .  |
|            . + o.. .    |
|      .  .  .S..  ..     |
|    .    .  o          . |
|     .    .               |
|                          |
|                          |
+-----------------+
bash-2.03#

이런 형식의 내용을 화면에 뿌려줍니다.  만들어진 파일은 /usr/local/etc/ 안에 있습니다.



6. sshd Daemon Script 작성

# vi /etc/init.d/sshd

#!/bin/sh

pid=`/usr/bin/ps -e | /usr/bin/grep sshd | /usr/bin/sed -e 's/^  *//' -e 's/ .*//'`
case $1 in
'start')
/usr/local/sbin/sshd
;;
'stop')
if [ "${pid}" != "" ]
then
/usr/bin/kill ${pid}
fi
;;
*)
echo "usage: /etc/init.d/sshd {start|stop}"
;;
esac


혹은

case "$1" in

'start')
     # Start the ssh daemon
     if [ -f /usr/local/sbin/sshd ]; then
          echo "starting SSHD daemon"
          /usr/local/sbin/sshd &
     fi
     ;;

'stop')
     # Stop the ssh deamon
     PID=`/usr/bin/ps -e -u 0 | /usr/bin/fgrep sshd | /usr/bin/awk '{print $1}'`
     if [ ! -z "$PID" ] ; then
          /usr/bin/kill ${PID} >/dev/null 2>&1
     fi
     ;;

*)
     echo "usage: /etc/init.d/sshd {start|stop}"
     ;;

esac
exit 0

둘중에 하나를 작성하시면 됩니다.

# chown root:sys /etc/init.d/sshd
sshd 파일의 소유자 및 그룹을  root:sys 로 변경

# chmod 555 /etc/init.d/sshd
sshd 파일의 권한을 555 (r-xr-xr-x)

# cat >> /etc/rc2.d/S99sshd
/etc/init.d/sshd start
Ctrl + C <- 이거 아시죠? 빠져나오기.. ^^

# chome 744 /etc/rc2.d/S99sshd
sshd 파일의 권한을 744 (rwxr--r--)

이렇게 하시면 Server Reboot 데몬이 자동 실행되어 가동이 됩니다.



7. SSH 실행 및 가동여부 확인

# /etc/rc2.d/S99sshd
starting SSHD daemon

# ps -ef | grep sshd
    root   478     1  0 16:16:27 ?        0:02 /usr/local/sbin/sshd

이렇게 띄워져 있다면 실행되고 있습니다.

해 보시고 문제가 있다면 댓글을 남겨주세요~!


출처 : 아이네트호스팅


솔라리스 시스템에서 갑작스런 패닉 현상이 나타나게 되면 보통 crash 디렉터리를 지정을
하지 않았다면 /var/crash/[hostname]/ 밑에 unix 파일과 core 파일을 남깁니다..

그 파일을 이용하여 시스템 패닉전에 무슨일이 있었는지 분석이 가능 합니다.

아래는 분석에 사용하는 명령어들과 보기입니다.

우선 core 파일과 unix파일이 있는 디렉터리로 이동 합니다. ( /var/crash/[hostname] )

1. strings

# strings vmcore.0 | grep SunOS ---> OS 의 종류를 보여준다.

# strings vmcore.0 | grep macine ---> 어떤 호스트인지 열거 하여 준다.

# strings vmcore.0 | more ---> 다 보여준다.

2. netstat

# netstat -d unix.0 vmcore.0 --> 네트웍 통계보기

# netstat -n unix.0 vmcore.0 --> NFS통계보기

3. arp

# arp -a unix.0 vmcore.0 --> arp 테이블보기

4. ipcs

# ipcs -a -N unix.0 -C vmcore.0 --> ipc 보기


5. crash

사용법 : crash [ -d dumpfile ] [ -n namelist ] [ -w output-file ]

예)

# crash -d unix.0 vmcore.0
dumpfile = vmcore.0, namelist = /dev/ksyms, outfile = stdout
> status
system name: SunOS
release: 5.7
node name: ns
version: Generic_106541-15
machine name: sun4u
time of crash: 수 11월 7 11:23:10 2001
age of system: 1 hr., 6 min.
panicstr: [AFT1] errID 0x000003a4.70f365cc %sError(s)
See previous message(s) for details
panic registers:
pc: 10010104 sp: 400275d8
> help
help [-w filename] function[s]
help function
alias:
acceptable aliases are uniquely identifiable initial substrings
> help p
p [-e] [-f] [-l] [-w filename] [([-p] [-a] tbl_entry | #procid)... | -r]
tbl_entry = slot number | address | symbol | expression | range
process table
alias: proc
acceptable aliases are uniquely identifiable initial substrings
p -e
PROC TABLE SIZE = 2922
SLOT ST PID PPID PGID SID UID PRI NAME FLAGS
0 t 0 0 0 0 0 96 sched load sys lock
1 s 1 0 0 0 0 58 init load
2 s 2 0 0 0 0 98 pageout load sys lock nowait
3 s 3 0 0 0 0 60 fsflush load sys lock nowait
4 s 347 1 347 347 0 58 sac load jctl
5 s 350 1 350 350 0 37 dmispd load
6 s 138 1 138 138 0 41 keyserv load
7 s 53 1 53 53 0 43 devfseventd load
8 s 57 1 57 57 0 50 devfsadm load
9 s 136 1 136 136 0 58 rpcbind load
10 s 205 1 205 205 0 53 nscd load
11 s 130 1 130 130 60001 58 tocsin load
12 s 188 1 188 188 0 52 syslogd load
13 s 178 1 178 178 0 58 automountd load
14 s 170 1 170 170 0 58 in.named load jctl
15 s 163 1 163 163 0 0 inetd load
16 s 233 228 228 228 1006 23 mshttpd load
17 s 300 267 0 0 0 58 mysqld load
18 s 193 1 193 193 0 49 cron load
19 s 232 228 228 228 1006 33 mshttpd load
20 s 228 1 228 228 0 59 mshttpd load
21 s 234 228 228 228 1006 13 mshttpd load
22 s 235 228 228 228 1006 3 mshttpd load
23 s 236 228 228 228 1006 0 mshttpd load
24 s 249 1 249 249 0 58 utmpd load
25 s 267 1 0 0 0 10 safe_mysqld load
26 s 253 1 253 253 0 58 sendmail load jctl
27 s 265 1 265 265 0 58 httpd load
28 s 10139 265 265 265 60001 58 httpd load
29 s 10146 265 265 265 60001 58 httpd load
30 s 10141 265 265 265 60001 58 httpd load
31 s 10151 265 265 265 60001 58 httpd load
32 s 10140 265 265 265 60001 58 httpd load
33 s 281 1 279 279 0 60 auditd load
36 s 331 1 331 331 0 48 dtlogin load jctl
37 s 325 1 325 325 0 23 mountd load
38 s 327 1 327 327 0 33 nfsd load
40 s 351 347 347 347 0 58 listen load nowait jctl
41 s 348 1 348 348 0 55 ttymon load
42 s 14566 331 14566 14566 0 59 Xsun load
43 s 352 347 347 347 0 58 ttymon load jctl
44 s 10137 265 265 265 60001 53 httpd load
50 s 14585 1 14574 14574 0 59 fbconsole load
55 s 14605 14574 14605 14605 0 59 dtgreet load
60 s 14574 331 14574 14574 0 50 dtlogin load
71 s 10150 265 265 265 60001 58 httpd load
76 s 10138 265 265 265 60001 58 httpd load
82 s 11077 265 265 265 60001 58 httpd load
90 s 11085 265 265 265 60001 58 httpd load
> p -l
p_lock: owner 0 waiters 0
cr_lock: owner 0 waiters 0
Condition variable p_cv: 0
Condition variable p_flag_cv: 0
Condition variable p_lwpexit: 0
Condition variable p_holdlwps: 0
Condition variable p_srwchan_cv: 0
82 s 11077 265 265 265 60001 58 httpd load

p_lock: owner 0 waiters 0
cr_lock: owner 0 waiters 0
Condition variable p_cv: 0
Condition variable p_flag_cv: 0
Condition variable p_lwpexit: 0
Condition variable p_holdlwps: 0
Condition variable p_srwchan_cv: 0
90 s 11085 265 265 265 60001 58 httpd load
.
.
.
. 이하생략..

> q

6. adb 사용하기

# adb -k unix.0 vmcore.0 ( unix파일이나 core파일 대신 커널쪽을 볼수도 있다 ex> adb -k /dev/ksyms /dev/mem )
adb -k unix.0 vmcore.0
physmem 5b01
*panicstr/s ---> 패닉 메세지가 무엇이었나 보여준다.
0x40027768: [AFT1] errID 0x000003a4.70f365cc %sError(s)
See previous message(s) for details
$<utsname ---> 호스트 이름과 장비에 관해 열거해준다.

utsname:
utsname: sys SunOS
utsname+0x101: node ns
utsname+0x202: release 5.7
utsname+0x303: version Generic_106541-15
utsname+0x404: machine sun4u

srpc_domain/s ---> 도메인
srpc_domain:
srpc_domain:

hw_provider/s ---> 제조업체
hw_provider:
hw_provider: Sun_Microsystems

*time-(lbolt%0t100)=Y --->부트시간/날짜
2001 Oct 6 21:26:01

$<msgbuf ---> 최근 메세지 버펄를 열거 하여 준다
SunOS Release 5.7 Version Generic_106541-15 [UNIX(R) System V R
elease 4.0]
0x700b57e0: Copyright (c) 1983-1999, Sun Microsystems, Inc.
0x700b53c3: Ethernet address = 8:0:20:86:23:9e
0x700b4fa0: mem = 196608K (0xc000000)
0x700b4b80: avail mem = 188989440
0x700b4763: root nexus = Sun Ultra 1 SBus (UltraSPARC 167MHz)
0x700b4343: sbus0 at root: UPA 0x1f 0x0 ...
0x70155ee3: sbus0 is /sbus@1f,0
0x70155ac0: dma0 at sbus0: SBus0 slot 0xe offset 0x8400000
0x701556a3: dma0 is /sbus@1f,0/espdma@e,8400000
0x70155280: /sbus@1f,0/espdma@e,8400000/esp@e,8800000 (esp0):
esp-options=0x46
0x70154e60: esp0 at dma0: SBus0 slot 0xe offset 0x8800000 Onboard device spa
rc9 ipl 4
0x70154a43: esp0 is /sbus@1f,0/espdma@e,8400000/esp@e,8800000
0x70154620: NOTICE: Memory scrubber exiting
0x70154200: sd0 at esp0:
0x70177d40: target 0 lun 0
0x70177923: sd0 is /sbus@1f,0/espdma@e,8400000/esp@e,8800000/sd@0,0
0x70177500: <FUJITSU-MAB3091SC-2703 cyl 7185 alt 2 hd 10 sec 248>
0x701770e0: sd1 at esp0:
0x70176cc0: target 1 lun 0
0x701768a3: sd1 is /sbus@1f,0/espdma@e,8400000/esp@e,8800000/sd@1,0
0x70176480: <SUN4.2G cyl 3880 alt 2 hd 16 sec 135>
0x70176060: sd4 at esp0:
0x70179c00: target 4 lun 0
0x701797e3: sd4 is /sbus@1f,0/espdma@e,8400000/esp@e,8800000/sd@4,0
0x701793c0: <SUN4.2G cyl 3880 alt 2 hd 16 sec 135>
0x70178fa0: sd6 at esp0:
0x70178b80: target 6 lun 0
0x70178763: sd6 is /sbus@1f,0/espdma@e,8400000/esp@e,8800000/sd@6,0
0x70178347: root on /sbus@1f,0/espdma@e,8400000/esp@e,8800000/sd@0,0:a fstyp
e ufs
0x700efee0: zs0 at sbus0: SBus0 slot 0xf offset 0x1100000 Onboard device spa
rc9 ipl 12
0x700efac3: zs0 is /sbus@1f,0/zs@f,1100000
0x700ef6a0: zs1 at sbus0: SBus0 slot 0xf offset 0x1000000 Onboard device spa
rc9 ipl 12
0x700ef283: zs1 is /sbus@1f,0/zs@f,1000000
0x700eee66: keyboard is </sbus@1f,0/zs@f,1000000> major <29> minor <2>
0x700eea46: mouse is </sbus@1f,0/zs@f,1000000:b> major <29> minor <3>
0x700ee626: stdin is </sbus@1f,0/zs@f,1000000> major <29> minor <2>
0x700ee200: cgsix0 at sbus0: SBus0 slot 0x1 offset 0x0 SBus level 5 sparc9 i
pl 9
0x7015fea3: cgsix0 is /sbus@1f,0/cgsix@1,0
0x7015fbe1: cgsix0: screen 1152x900, single buffered, 1M mappable, rev 11
0x7015f926: stdout is </sbus@1f,0/cgsix@1,0> major <39> minor <0>
0x7015f660: cpu0: SUNW,UltraSPARC (upaid 0 impl 0x10 ver 0x22 clock 167 MHz)
0x7015f3a0: ledma0 at sbus0: SBus0 slot 0xe offset 0x8400010
0x7015f0e0: le0 at ledma0: SBus0 slot 0xe offset 0x8c00000 Onboard device sp
arc9 ipl 6
0x7015ee23: le0 is /sbus@1f,0/ledma@e,8400010/le@e,8c00000
0x7015eb63: dump on /dev/dsk/c0t0d0s1 size 1000 MB
0x7015e8a2: pseudo-device: devinfo0
0x7015e5e3: devinfo0 is /pseudo/devinfo@0
0x7015e320: fd0 at sbus0: SBus0 slot 0xf offset 0x1400000 Onboard device spa
rc9 ipl 11
0x7015e063: fd0 is /sbus@1f,0/SUNW,fdtwo@f,1400000
0x70559d60: sbusmem0 at sbus0: SBus0 slot 0x0 offset 0x0
0x70559aa3: sbusmem0 is /sbus@1f,0/sbusmem@0,0
0x705597e0: sbusmem1 at sbus0: SBus0 slot 0x1 offset 0x0
0x70559523: sbusmem1 is /sbus@1f,0/sbusmem@1,0
0x70559260: sbusmem2 at sbus0: SBus0 slot 0x2 offset 0x0
0x70558fa3: sbusmem2 is /sbus@1f,0/sbusmem@2,0
0x70558ce0: sbusmem3 at sbus0: SBus0 slot 0x3 offset 0x0
0x70558a23: sbusmem3 is /sbus@1f,0/sbusmem@3,0
0x7042b70b: WARNING: [AFT1] EDP event on CPU0 Data access at TL=0, errID 0x0
00003a4.70f365cc
AFSR 0x00000000.80400002<PRIV,EDP> AFAR 0xffffffff.ffffffff
AFSR.PSYND 0x0002(Score 95) AFSR.ETS 0x00 Fault_PC 0x1018af18
UDBH 0x0000 UDBH.ESYND 0x00 UDBL 0x0000 UDBL.ESYND 0x00
0x7055834b: [AFT2] errID 0x000003a4.70f365cc No error found in ecache (No fa
ult PA available)
0x70558080: panic[cpu0]/thread=40027e60:
0x70558b80: [AFT1] errID 0x000003a4.70f365cc EDP Error(s)
See previous message(s) for details
0x70154fc0:
0x7015f7c3: syncing file systems...
0x7015fd43: [4]
0x7015f243: [4]
0x7015f500: panic[cpu0]/thread=4003fe60:
0x700ef800: panic sync timeout
0x7015ea00:
0x700efc23: dumping to /dev/dsk/c0t0d0s1, offset 209780736

$c ---> C 스택 역추적
complete_panic(0xf,0x10437c00,0x40027e60,0x7011478a,0x0,0x10107880) + 24
do_panic(0x1,0x40027954,0x10107f70,0x0,0x0,0x400277bb) + 174
vcmn_err(0x3,0x40027768,0x40027954,0x7efefeff,0x81010100,0xff00) + 14
cpu_aflt_log(0x400278f8,0x400277bb,0x40027978,0x3,0x1010785c,0x10107880) + 4c0

rootfs$<bootobj ---> 루투장치는 어떤것인가

rootfs:
rootfs: fstype ufs^@^@^@^@^@^@^@^@^@^@^@^@^@
rootfs+0x10: name /sbus@1f,0/espdma@e,8400000/esp@e,8800000/sd@0,0:a^@^@^@
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
^@^@^@^@^@^@^@^@^@^@^@
rootfs+0x90: flags size vp
0 0 0

swapfile$<bootobj ---> 스왑장치는 어떤것인지 열거

swapfile:
swapfile: fstype ^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
swapfile+0x10: name ^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
^@^@^@^@
swapfile+0x90: flags size vp
0 0 0

$q ---> 종료


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

자동분석 스크립트입니다.


사용방법은

#/var/crash/[hostname]/
안에 위의 파일을 넣어놓습니다.  만약 갑자기 reboot 되거나 하면 dumpadm.conf 및 coreadm.conf 를 건드리지 않는한 위의 경로에 unix.0 vmcore.0 등의 파일이 생기게 됩니다.
"hostname" 이 Server name 이라는건 아시겠죠?

그다음  #/var/crash/[hostname]/iscda unix.0 vmcore.0 >> /log/iscda.txt

이렇게 하시고

#vi /log/iscda.txt 파일을 보시면 됩니다.

[스크랩] Crash Dump & Core File

Posted 2009. 1. 23. 17:37

출처: http://blog.naver.com/tangamjaelt?Redirect=Log&logNo=43605204

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

# source site : blog.naver.com/tangamjaelt

#   master : 강용운

#   email : tangamjaelt@korea.com

#   last release : 2007.10.29

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

 

crash dump : 시스템에 치명적인 오류가 발생하였을 경우 생성

core file : 각각의 프로세스에 오류가 발생하였을 경우 생성

 

 

1. crash dump

 

- OS에 치명적인 에러가 발생하게 되면, OS는 콘솔에 해당 메시지를 보여주며, 메모리에 있는 내용을 미리 지정한 dump device 에 crash dump를 생성하고 reboot 한다.

- dump device 는 local disk 의 swap 파티션이다.

- dump contents 는 메모리에 있는 kernel memory page 로 구성된다.

- Solaris kernel 이 데이터 무결성에 대한 문제나, H/W fault 를 만나게 되면 panic 루틴이 수행된다.

- System panic 은 메모리 정보를 dump device 에 복사하는 이벤트이다.

- crash dump 를 통해 치명적 에러에 대한 원인을 분석할 수 있다.

- dumpadm 명령을 사용하여 dump device를 구성한다.

 

- dump 시 savecore 명령이 부팅할동안 자동 실행된다.

- savecore 명령은 dump device 로부터 crash dump 를 다시 가져오는 역할을 하며, 가져온 crash dump 를 파일시스템에 쓴다.

- savecore 명령은

   - /var/crash/hostname/vmcore.X(덤프식별번호) 파일에 kernel core 정보를 둔다.

   - /var/crash/hostnmae/unix.X 파일에 namelist 와 symbol table 정보를 둔다.

 

- crash dump 디렉토리 내에 bounds 파일이 생성된다.

- bounds 파일은 다음에 저장될 dump의 앞번호를 가지고 있다.

- dumpadm 명령을 통해 dump device를 설정하고, savecore 의 디렉토리 위치를 설정한다.

dumpadm - configure operating system crash dump

# dumpadm

 

사용자 삽입 이미지








 

- Savecore enabled: yes 는 부팅 시 자동으로 savecore 명령이 구동되게 하는 설정이다.

# cat /etc/dumpadm.conf

 

사용자 삽입 이미지














 

- dumpadm 설정 파일이나 직정 수정하지 않고, dumpadm 명령을 사용하여 변경하도록 한다.

dumpadm 옵션

-y : yes. 부팅 시 savecore 명령 실행.

-n : no. 부팅 시 savecore 명령 실행 안함.

-u : update. kernel의 dump 구성을 강제적으로 /etc/dumpadm.conf 파일을 내용으로 업데이트.

-d : dump-device. 절대경로 또는 swap.

-c : contents-type. kernel, all, curproc 중 하나 선택 (curproc = kernel memory page + 현재 실행중인 프로세스의 memory page)

-r : root-dir. 기본적으로 (/)로 지정됨.

-s : savecore-dir. savecore 명령 실행 시 생성되는 파일의 디렉토리 지정. 기본적으로 /var/crash/hostname

-m : 현재 savecore-dir 에 minfree 파일을 생성.

 

 



2. core file

 

- 프로세스가 비정상적으로 종료되었을 경우 core 파일이 생성된다.

- core 파일은 프로세스에 문제가 생길 당시에 프로세스에 할당된 메모리의 snapshot 이다. (RAM → Disk)

- core 파일은 프로세스의 문제점을 분석을 하는데 사용한다.

- coreadm 명령을 사용하여 core파일의 위치와 이름을 설정한다.

 

core 파일의 종류

- global core file : mode 600 으로 생성되고, superuser 가 소유한다.

- per-process core file : mode 600 으로 생성되고, 프로세스 구동 user 가 소유한다.

 

coreadm - core file administration

 

# coreadm

 

사용자 삽입 이미지















global core file pattern :
/var/core/core.%f.%p.%u (global core 파일의 생성 위치 및 core 파일의 생성 이름 설정)

init core file pattern : core (프로세스 별로 사용하게 될 core 파일의 이름 설정)

global core dumps : disabled (global core 파일 생성 안함)

per-process core dumps : enabled (per-process core 파일 생성함)

global setid core dumps : disabled (setUID, setGID 권한으로 실행 된 프로세스에 대한 global core 파일 생성 안함)

per-process setid core dumps : disabled (setUID, setGID 권한으로 실행 된 프로세스에 대한 per-process core 파일 생성 안함)

global core dump logging : disabled (로그 안남김)

# /etc/coreadm.conf

 

사용자 삽입 이미지


















- 직접 수정하지 말고 coreadm 명령을 사용함.

- coreadm 실행 시 나타내는 항목과 같음.

coreadm 옵션

-i 패턴 : core 파일의 경로와 이름 설정  

-e 옵션 : enabled. 옵션은 global, process, global-setid, proc-setid, log 중 하나.

-d 옵션 : disabled.

-u : /etc/coreadm.conf 파일을 강제로 업데이트.

-g 패턴 : global core 파일의 경로와 이름 설정

-p 패턴 : per-process core 파일의 경로와 이름 설정

 

패턴 옵션

%p : PID

%u : effective UID

%g : effective GID

%f : 실행 파일 이름

%n : hostname (uname -n)

%m : machine name (uname -m)

%t : 시간

%% : 문자열


# coreadm -e process enable

# coreadm -g /var/core/core.%f.%p -e global

# coreadm -p $HOME/corefiles/%n.%f.%p $$ -e process ($$는 현재 PID)

# coreadm 278 3483  (특정 PID를 가지는 프로세스에 대한 core file 구성 체크)

 

사용자 삽입 이미지













# cat /etc/coreadm.conf

 

사용자 삽입 이미지












 

- file 명령으로 프로세스를 확인할 수 있다.

 

사용자 삽입 이미지

















[스크랩] CPU 와 Memory Error...

Posted 2009. 1. 22. 20:29

[출처] [펌]Solaris CPU와 메모리 이벤트 관련|작성자 대충쏜다



Solaris device간 통신을 할 경우 data의 정합성을 보장하기 위해

Data 전송 시 parity 값을 같이 전송하며 만약 data를 받을 때 정합성에

문제가 있을 경우 parity를 이용해 data를 보정한다.

 

일반적인 반도체 소자의 경우 일정량의 전자파 방출이 있으며 특정 환경에서(온도,습도 비적정 및 다른장비 에서 발생되는 전자파의 간섭이 있을경우)

전자파 방출량이 많아지게 되는 현상이 발생하면서 bit 오류를 발생 시키는 경우가 있다.

 

위에서 처럼 parity data를 보정 가능할 경우를 CE(correctable Error)라 하며

word double bit오류가 발생하여 data 보정이 불가능 할 경우를 UE(Uncorrectable Error)

하며 UE의 경우 hardware error로 간주하여 해당 part를 교체 해야한다.

 

다는 vendor의 제품들과 같이 Sun system memory의 경우 ECC(Error check & correct) 기능이

있는 memory를 사용하며 CPU scrubber 기능을 두어 CE UE error control한다.

 

CE error error fix한후 messages에 정상적으로 device가 동작했음을 알려주는

notice를 나타내며 UE의 경우 hardware error로 해당 device down시키거나 system reset

가해 지게 된다.

 

그러나 CE error가 동일 part에 대해서 계속적으로 발생할 경우는 hardware적인 오류가 있을수

있으므로 해당 part를 교체해 주어야 한다.

 

 

 

3.Messages file 분석법

 

 

1) Memory CE Error관련(eprjdb2 분석)

May 22 11:09:50 eprjdb2 SUNW,UltraSPARC-II: [ID 362078 kern.info] [AFT0] Corrected Memory Error

 detected by CPU11, errID 0x001dd49c.d54e5a7b

May 22 11:09:50 eprjdb2 SUNW,UltraSPARC-II: [ID 589262 kern.info] [AFT0] errID 0x001dd49c.d54e5

a7b Corrected Memory Error on Board 5 J3101 is Persistent

 

CE error의 경우 위의 sample에서 처럼 다음과 같은 3가지 type message display된다.
 
"Intermittent"  : data에 오류가 있어 다시 해당 word read할시 error가 없는 경우로
memory module 교체는 필요 없다.
 
"Persistent"   : data에 오류가 있어 다시 해당 word read할시 또 오류가 있는 경우로
memory scrub operation으로 해당 bit fix를 수정한 경우로
 module에서 계속적인 error(24시간내 4번 이상) 없을 경우 memory 교체는
 필요 없다.
 "Sticky"-     persistent error bit를 수정한 이후에도 error fix되지 않는 경우로 
 error가 발생하면 즉시 memory를 교체해 주어야 한다.
 

eprjdb2의 경우는 persistent로 만약 24시간내 동일 장애가 4회 이상 발생하지 않을시

memory교체는 필요 없으며 추후 동일 장애가 발생하는지 monitoring이 필요하다.

 

 

 

2) CPU CE error 관련(zoisite 분석)

May 24 04:01:38 zoisite SUNW,UltraSPARC-II: [ID 359263 kern.info] [AFT2] E$Data (0x20):

 0x00000000.00000000

May 24 04:01:38 zoisite SUNW,UltraSPARC-II: [ID 359263 kern.info] [AFT2] E$Data (0x30):

 0x00000000.00000000

May 24 04:01:38 zoisite SUNW,UltraSPARC-II: [ID 522370 kern.info] NOTICE: [AFT2] errID

0x00048964.88b46551 CBI event on CPU15

May 24 04:01:38 zoisite SUNW,UltraSPARC-II: [ID 147036 kern.info] [AFT2] errID 0x000489

64.88b46551 PA=0x00000000.007bd600

 

 

Memory의 경우 12시간에 최소 한번 이상의 scrubber가 동작하여 모든 memory scan하여

정합성 여부를 test하나 CPU memory bit점검과 비슷한 방식으로 정합성 test는 하지만

초당 최소 한번 이상의 scrubber가 동작 하면서 Ecache memory를 점검한다.

이경우 single bit오류가 발생했을시 다음과 같은 CBI/CBB/DBI/DBB형태로 message

표출하며 만약 double bit오류가 발생할 시에는 UE error로 시스템이 reset되게 된다.

 

clean_bad_idle : CBI event  à해당 data를 사용치 않으나 bad로 판명되어 re-read error
                             없는 경우
clean_bad_busy : CBB event à해당 data를 사용하지만 bad로 판명되어 re-read error 없는경우
dirty_bad_idle : DBI event à해당 data를 사용치 않으나 bad로 판명되어 bit 수정

dirty_bad_busy : DBB event à 해당 data를 사용하지만 bad로 판명되어 bit 수정

 
위의 zoisite 경우 cpu 15번의 CBI event ecach bit 오류가 있었으나 re-read 
error가 없는 경우로 이는 단순 scrubber가 정상적으로 동작 했음을 나타내는 message
cpu 교체는 필요 없다.
 

3) CPU UE error 관련

WARNING: [AFT1] EDP event on CPU1 Instruction access at TL=0, errID

0x0000ad88.6cd9989f

         AFSR 0x00000000.80408000<PRIV,EDP> AFAR 0x00000000.0f0c8080

         AFSR.PSYND 0x8000(Score 95) AFSR.ETS 0x00 FAULT_PC 0x780b481c

         UDBH 0x0000 UDBH.ESYND 0x00 UDBL 0x0000 UDBL.ESYND 0x00

 

CPU UE error는 다음과 같은 방식으로 display 되며

message display될 경우는 해당 cpu를 교체 해야 한다.

 

EDP(Ecache Data Parity Event)

  CPU Ecache Data SRAM(cpu 상에 있는 cache memory 이름)

으로부터 Data Reading할시 parity error가 발생한경우 발생

 

WP(Write Back Data Parity Error)

  CPU Ecache로부터 main memorydata written back될시에

  Cpu상의 UDB(Ultra Data Buffer) chip에서 parity error를 발생할시

 

CP(Copy Out Data Parity Error)

  특정 cpu로부터 다른 cpu ecache data copy할시 parity error 발생

 

 

-CPU관련 error messages설명

 

Cpu error발생시 시스템 console이나 /var/adm/messages ,core file등에

다음과 같은 message가 출력되며 type별로 설명하면 다음과 같다.

 

 

Category 1: Messages that identify the type and source of an error

 ------------------------------------------------------------------

 

       WARNING: [AFT1] EDP event on CPU1 Instruction access at TL=0, errID

0x0000ad88.6cd9989f

         AFSR 0x00000000.80408000<PRIV,EDP> AFAR 0x00000000.0f0c8080

         AFSR.PSYND 0x8000(Score 95) AFSR.ETS 0x00 FAULT_PC 0x780b481c

         UDBH 0x0000 UDBH.ESYND 0x00 UDBL 0x0000 UDBL.ESYND 0x00

 

       [Score 95] data parity error가 발생할시 Error 원인을 제공한 cpu는 확률방식으로

                checking하게 되며 50이상으로 표시되는cpu fault임을 뜻한다.

                위의 sample의 경우 score 95인 경우이므로 cpu1 hardware 오류가

                있음을 뜻한다.

 

 

Category 2: Messages that supply a cache line or memory dump

   ------------------------------------------------------------

     [AFT2] errID 0x0000ad88.6cd9989f PA 0x00000000.0f0c8080 E$tag

0x00000000.0bc001e1 E$State: Modified E$parity 0x05

      [AFT2] E$Data (0x00): 0xffffffff.beefface *Bad* PSYND=0x8000

      [AFT2] E$Data (0x08): 0x00000000.00000000

      [AFT2] E$Data (0x10): 0x6d656d6d.6f727920

      [AFT2] E$Data (0x18): 0x6572726f.7220696e

      [AFT2] E$Data (0x20): 0x6a656374.6f720000

      [AFT2] E$Data (0x28): 0x6d656d74.65737420

      [AFT2] E$Data (0x30): 0x6d757465.780059f8

      [AFT2] E$Data (0x38): 0x00000300.00c11000

      [AFT2] Event PA displayed in AFAR was derived from E$Tag

 

      [AFT2] 추후 분석을 위한 cache memory,main memory dump를 뜻하는 표시어

 

Category 3: Messages from the kernel error recovery code

   --------------------------------------------------------

      [AFT3] errID 0x00000058.0d0dc830 Above Error detected by protected Kernel code

          that will try to clear error from system

 

      [AFT3] error발생시 kernel상에서 detect code display하는 표시어

 



Solaris 서버정보 확인 명령어

1. 솔라리스 버전 및 업데이트 번호
[SOLARIS:/]cat /etc/release
                     Solaris 8 HW 7/03 s28s_hw3wos_05a SPARC
           Copyright 2003 Sun Microsystems, Inc.  All Rights Reserved.
                             Assembled 11 June 2003


2. 서버의 모델 출력
[SOLARIS:/]prtconf -vp | grep banner-name
    banner-name:  'Sun Fire V240'


3. 서버 정보
[SOLARIS:/]uname -a
SunOS SOLARIS 5.8 Generic_108528-22 sun4u sparc SUNW,Sun-Fire-V240
   ⓐ          ⓑ      ⓒ             ⓓ               ⓔ       ⓕ      ⓖ            ⓗ
ⓐ System(OS)
ⓑ Hostname
ⓒ Release
ⓓ Kernel Version(ID)
ⓔ Kernel architecture(그외 i86pc, sun4m, sun4c 등)
ⓕ Application architecture(그외 sparc, i386, i686등
ⓖ Maker?
ⓗ Banner

-a 옵션이 아닌 -X 옵션으로 좀더 쉽게 볼 수 있으며 비슷한 명령어로는 showrev명령어가 있습니다.

[SOLARIS:/]showrev
Hostname: SOLARIS
Hostid: 838e1e19
Release: 5.8
Kernel architecture: sun4u
Application architecture: sparc
Hardware provider: Sun_Microsystems
Domain:
Kernel version: SunOS 5.8 Generic 108528-22 May 2003

일반적으로 uname -v 명령어를 통해 설치된 Kernel에 적용된 최신 패치를 보여 주며
uname -srv 명령어를 통해 OS와 Kernel을 같이 본다. 하지만 좀더 자세한 정보를 원한다면
showrev -p 명영어를 통해 좀더 자세한 정보를 확인할 수 있습니다.

[SOLARIS:/]showrev -p | more
Patch: 109879-02 Obsoletes: 109654-02 Requires: 109877-01 Incompatibles:  Packages: SUNWcarx, SUNWcsr

패치가 많이 이루어 졌다면 상당량의 라인이 지나갈 것입니다. 때문에 more명령을 같이 넣어주면 확인하는대 불편함이 없을 것입니다.
Patch: 109879-02는 이 패치로 인해 109654-02 패치가 쓸모없어 제거 됬으며, 이 패치를 설치하기 위한 선행 패치로 109877-01이 설치되어야 하며, 관련 패키지는 SUNWcarx와 SUNWcsr이 있다는 것을 의미 한다.


4. 장착(monut)된 Disk(갯수) 확인
[SOLARIS:/]iostat -nE
c1t0d0          Soft Errors: 0 Hard Errors: 0 Transport Errors: 0
Vendor: FUJITSU  Product: MAP3367N SUN36G  Revision: 0401 Serial No: 00N0BPPN    
Size: 36.42GB <36418595328 bytes>
Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0
Illegal Request: 0 Predictive Failure Analysis: 0
>>
c1t1d0          Soft Errors: 0 Hard Errors: 0 Transport Errors: 0
Vendor: SEAGATE  Product: ST336607LSUN36G  Revision: 0307 Serial No: 3JA65ZTV00007349
Size: 36.42GB <36418595328 bytes>
Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0
Illegal Request: 0 Predictive Failure Analysis: 0

보기 쉽게 중간에 공백을 넣어 놓았습니다. 실제로 명령어를 입력했을때
는 공백이 존재하지 않습니다.

c1t0d0(FUJITSU)와 c1t1d0(SEAGATE) Disk, 이렇게 두게의 Disk가 보입니다.
df -k 명령어로 용량을 확인해 봐도 Filesystem부분에

[SOLARIS:/]df -k
Filesystem                  kbytes      used      avail capacity  Mounted on
/dev/dsk/c1t0d0s0      1016122    222789    732366    24%    /
/dev/dsk/c1t0d0s4      1016122    719173   235982    76%     /usr
/dev/dsk/c1t0d0s1       492872    173737    269848    40%    /var
/dev/dsk/c1t0d0s6    30879855     91478 30479579      1%    /backup
/dev/dsk/c1t0d0s5       492872    175590    267995    40%    /tmp
/dev/dsk/c1t1d0s6    35009161 30749312  3909758     89%    /home1

총 6개의 파티션으로 나뉜 두게의 Disk가 보입니다.
/dev/dsk/c1t0d0s[04165], /dev/dsk/c1t1d0s6

※ 참고
솔라리스는 장착된 디스크에 대한 물리적인 정보를 ‘devices.....’라는 디렉토리에 보관한 후 솔라리스가 실제 사용하는 이름으로 링크하는데 앞의 예제가 바로 그것이다. 이때 솔라리스는 물리적인 디스크에 대한 사용 방식을 두가지로 정의한다. 디스크를 있는 그대로 사용하기 위한(raw device) 방법으로 ‘/dev/rdsk/...’에 링크를 저장하는 방법과, 디스크를 솔라리스의 파일 시스템용으로 사용하기 위해 별도의 링크를 ‘/dev/dsk/...’ 디렉토리에 저장하는 방법이 있다.
일반적으로 오라클과 같은 데이터베이스나 특정 애플리케이션은 파일 시스템과 관련없이 로 디바이스(raw device)를 사용하기 때문에 ‘/dev/rdsk/....’ 밑의 파일을 사용한다. 한편 솔라리스가 직접 제어하는 파일 시스템은 블럭 디바이스(block device)를 사용하며 ‘/dev/dsk/....’ 밑의 디스크 링크를 사용한다.
따라서 어느 쪽이나 사용자가 앞의 예제와 같이 ls 명령을 실행하면 솔라리스가 인지한 디스크의 정보를 얻을 수 있다. 앞의 예제에서 표시된 내용을 해석해보면 세개의 디스크 컨트롤러(c0,c1,c2)가 장착돼 있으며, 0번 컨트롤러에는 t1 디스크 하나, 1번 컨트롤러에는 t6 디스크 하나, 2번 컨트롤러에는 t10과 t11이라는 두개의 디스크가 연결돼, 총 4개의 디스크가 시스템에 장착돼 있다는 것을 알 수 있다.

참고 사이트 : http://blog.naver.com/wooya510?Redirect=Log&logNo=60008927738


5. CPU 구성 확인
[SOLARIS:/]psrinfo -v 또는
[SOLARIS:/]/usr/sbin/psrinfo -v
Status of processor 0 as of: 11/07/08 14:46:54
  Processor has been on-line since 10/15/08 21:30:42.
  The sparcv9 processor operates at 1002 MHz,
        and has a sparcv9 floating point processor.

한개의 SPARCV9 1002MHz짜리 CPU가 있음을 보여주고 있습니다.
만약 여러게 였다면 위와 같은 정보가 여러번 나오게 됩니다.
때문에 한번에 갯수만 출력하는 명령어를 친다면 다음과 같이 입력하면 됩니다.

[SOLARIS:/]psrinfo -v | grep "Status of processor" | wc -l      
       1


6. Memory Size보기
[SOLARIS:/]prtconf | grep "Memory"
Memory size: 512 Megabytes


7. CPU점유율 확인
[SOLARIS:/]prstat
   PID USERNAME    SIZE   RSS STATE  PRI NICE   TIME CPU  PROCESS/NLWP
   296            root    443M  258M   sleep   59  -20   3:00.02   5.4%        SOLARIS/17
   311            root   3464K 1600K    sleep  58    0    0:22.13   0.1%        SOLARIS/1
    70            root    3920K 2440K   sleep   31    0   0:00.00   0.1%         picld/6
  3227    SOLARIS   1584K 1216K    cpu0   58    0   0:00.00   0.0%          prstat/1
 19074   SOLARIS   6688K 2016K       run   58    0   0:00.00   0.0%         sshd/1
 27216   SOLARIS   2560K 1784K   sleep    48    0   0:00.00   0.0%         bash/1
 27211          root    6696K 2712K   sleep   38    0   0:00.00   0.0%          sshd/1
 27245          root    2560K 1784K   sleep   58    0   0:00.00   0.0%          bash/1
 19072          root    6696K 2760K   sleep   22    0   0:00.00   0.0%          sshd/1
   272           root    5272K 1328K   sleep   20    0   0:00.00   0.0%          dtlogin/4
   310           root    1840K  632K   sleep   58    0   0:00.00   0.0%          ttymon/1
   210           root    3680K 1112K   sleep   58    0   0:00.00   0.0%         vold/5
   186           root    1048K  512K   sleep   58    0   0:00.03   0.0%          utmpd/1
   163           root    2064K  968K   sleep   48    0   0:01.35   0.0%          cron/1
   159           root    4088K 1592K   sleep  59    0   0:00.00   0.0%           syslogd/11
   152           root    1824K  440K   sleep   50    0   0:00.00   0.0%          inetd/1
 19076   SOLARIS   2560K 1792K      run   48    0   0:00.00   0.0%          bash/1
   130           root    2240K  272K   sleep    5    0   0:00.00   0.0%          rpcbind/1
   178           root    4056K 1280K   sleep    0    0   0:00.06   0.0%          sshd/1
    59            root   1752K  712K   sleep   30    0   0:00.00   0.0%          syseventd/12
 27214   SOLARIS   6688K 2008K   sleep   58    0   0:00.00   0.0%         sshd/1
    68            root   2760K  920K   sleep   53    0   0:00.00   0.0%         devfsadm/7
  2790           root   9776K 8240K   sleep    0    0   0:00.06   0.0%          nvfs/1
   308           root    1864K  520K   sleep   38    0   0:00.00   0.0%         ttymon/1
   307           root    1832K  528K   sleep   59    0   0:00.00   0.0%         sac/1
     1            root     840K  264K   sleep   58    0   0:00.43   0.0%         init/1
 

Total: 26 processes, 108 lwps, load averages: 0.06, 0.10, 0.12

하지만 이렇게 입력하면 한번 출력하고 끝이기 때문에 다음과 같이 입력 합니다.

[SOLARIS:/]prstat 5 5

이렇게 입력하면 prstat 명령여를 5초에 한번씩 5번 친 효과가 나타 납니다.
즉, 5초 간격으로 총 5번 자동적으로 prstat값이 reflash됩니다.


8. 시스템 장치의 정보 확인
[SOLARIS:/]uname -i
SUNW,Sun-Fire-V240
   ⓐ             ⓑ
Maker       Banner
이를 이용해 시스템 장치의 정보를 확인 할 수 있다.

[SOLARIS:/]/usr/platform/`uname -i`/sbin/prtdiag | more
System Configuration: Sun Microsystems  sun4u Sun Fire V240
System clock frequency: 167 MHZ
Memory size: 512MB     
==================================== CPUs ====================================
                      E$          CPU     CPU       Temperature         Fan
       CPU  Freq      Size        Impl.   Mask     Die    Ambient   Speed   Unit
       ---  --------  ----------  ------  ----  --------  --------  -----   ----
     MB/P0  1002 MHz  1MB         US-IIIi  2.4       -        -   
================================= IO Devices =================================
     Bus   Freq
Brd  Type  MHz   Slot        Name                          Model
---  ----  ----  ----------  ----------------------------  --------------------
 0   pci    66           MB  pci108e,1648 (network)                          
 0   pci    66           MB  pci108e,1648 (network)                          
 0   pci    33           MB  isa/su (serial)                                 
 0   pci    33           MB  isa/su (serial)                                 
 0   pci    33           MB  pci10b9,5229 (ide)                              
 0   pci    66           MB  scsi-pci1000,21 (scsi-2)                        
 0   pci    66           MB  scsi-pci1000,21 (scsi-2)                        
 0   pci    66           MB  pci108e,1648 (network)                          
 0   pci    66           MB  pci108e,1648 (network)                          
 0   pci    33            7  isa/rmc-comm-rmc_comm (seria+                   
============================ Memory Configuration ============================
Segment Table:
-----------------------------------------------------------------------
Base Address       Size       Interleave Factor  Contains
-----------------------------------------------------------------------
0x0                512MB             1           BankIDs 0
Bank Table:
-----------------------------------------------------------
           Physical Location
ID       ControllerID  GroupID   Size       Interleave Way
-----------------------------------------------------------
0        0             0         512MB           0
Memory Module Groups:
--------------------------------------------------
ControllerID   GroupID  Labels
--------------------------------------------------
0              0        MB/P0/B0/D0,MB/P0/B0/D1
=============================== usb Devices ===============================
Name          Port#
------------  -----
keyboard        2
======== FRU Status =========
-------------------------
Fru Operational Status:
-------------------------
Location        Status  
-------------------------
MB/SC           okay
PS0             okay
HDD0            present
HDD1            present
 

 

« PREV : 1 : 2 : 3 : 4 : 5 : 6 : 7 : 8 : ··· : 18 : NEXT »