2009년 1월 5일 월요일

Solaris 정보확인 명령어

1. 기본적인 정보 확인

■ CDE 환경에서 정보 확인 (GUI)
CDE > Pannel > System Info

■ uname 명령어를 통한 정보 확인 (운영체제 확인
# uname –a
SunOS sun 5.10 Generic_127127-11 sun4u sparc SUNW,Sun-Fire-480R

■ /etc/release 파일을 통한 정보 확인
# cat /etc/release

■ ipcs 명령어를 사용한 큐, 공유메모리, 세마포어 설정 확인
# ipcs
[참고] sysdef 명령어를 사용해서도 확인이 가능하다

■ Solaris 버전을 확인
# cat /var/sadm/softinfo/INST_RELEASE
영체제 SunOS
서버명 sun
버전은 5.10
커널 패치127127이며
커널 패치의 리비전은 11
애플리케이션 아키텍쳐 sun4u
시스템 모델 Sun-Fire-480R

■설치된 OS 가 64 비트인지 32 비트인지 확인
/bin/isainfo –kv
<ex>
64-bit sparcv9 kernel modules

2. 시스템 장치의 정보 확인

■ /usr/platform/`uname -i`/sbin/prtdiag

# /usr/platform/`uname -i`/sbin/prtdiag | more

주의) Intel Platform 인 경우 명령어가 존재하지 않는다.
- 시스템의 종류(범주)와 시스템 클럭
- 총 메모리 크기
- 구성되어 있는 시스템 보드의 수
- 각 시스템 보드의 CPU와 메모리의 수와 종류
- 메모리 읽기 방식(Interleave)
- 설치된 I/O 카드(네트워크나 채널 I/O 등)
- 시스템에 구성된 보드 중 발생한 장애와 현재 구성되어 있지만 사용하지 않는 시스템
  정보도 언급된다. (이 경우 썬 서버만)

# /usr/platform/`uname -i`/sbin/prtdiag -v
# /usr/platform/`uname -i`/sbin/prtdiag –l

  -l    Log output. If failures or errors exist in the system,
           output this information to syslogd(1M) only.
-v    Verbose mode. Displays the time of the most recent  AC
           Power  failure,  and  the  most  recent hardware fatal
           error information, and (if  applicable)  environmental
           status. The hardware fatal error information is useful
           to repair and manufacturing for  detailed  diagnostics
           of FRUs.

예) Brd Type MHz Slot Name Model
    1   SBus 25  0    SUNW,sbus-gem
SUNW,sbus-gem 모델의 네트워크 카드가 Sbus 타입의 I/O 보드 1번의 0번 슬롯에 설치 되
어 있는것을 의미한다. SUNW,sbus-gem은 썬에서 제작한 sbus용 gem(기가비트 멀티모드
파이버 연결)카드다.


3. 시스템 패치 정보 확인

■ 모든패치에 대한 확인
# showrev -p | more
......
Patch: 114433-10 Obsoletes: 115485-01 Requires:  Incompatibles:  Packages: SUNWcsu,
        SUNWcsl, SUNWesu, SUNWtoo, SUNWmdb, SUNWscpu, SUNWtnfc, SUNWcpcu, SUNWrcapu,
SUNWrmwbu
......

위의 내용을 해석하여 보면 114433-10 설치 되어 있으며 이 패치의 설치로 인해서
115485-01 쓸모없이 제거되었고(Obsoletes), 이 패치를 설치 하기위해서 먼저 필요한
패치는 없고(Requires), 관련 패키지는 SUNWcsu, SUNWcsl, SUNWesu....등이다.

■ 커널 패치에 대한 확인
# uname -srv
SunOS 5.9 Generic_118559-11
위의 내용을 해석하여 보면 설치된 운영체제 커널에 적용된 최신패치를 보여준다.
uname 명령어의 -a 옵션을 사용한 경우에도 보여 준다. 그 부분을 참고 하자.

4. 가상 메모리의 확인

■ swap

# swap -s
total: 45544k bytes allocated + 18984k reserved = 64528k used, 722236k available

# swap -l
swapfile             dev  swaplo blocks   free
/dev/dsk/c1d1s1     102,129      8 1048936 1048936

[참고] SolarisMemroyAdmin.txt 파일 참조


5. 디스크 정보의 확인


■ 장착된 디스크(인식된 디스크, Device Reconfiguration)
    /etc/path_to_inst, prtconf | grep -v not

# ls -l /dev/rdsk/*s2
lrwxrwxrwx   1 root     root          54 Dec  7 04:20 /dev/rdsk/c0d0s2 -> ../../devices/pci@0,0/pci-ide@7,1/ide@0/cmdk@0,0:c,raw

# cat /etc/path_to_inst | grep sd
"/pci@0,0/pci-ide@7,1/ide@1/sd@0,0" 0 "sd"
# cat /etc/path_to_inst | grep dad

# cat /etc/path_to_inst | grep cmdk
"/pci@0,0/pci-ide@7,1/ide@0/cmdk@0,0" 0 "cmdk"

# prtconf | grep -v not


■ 디스크별 제조사와 모델명 확인
    iostat -nE, format(inquiry)

# iostat –nE

     -n    Display names  in  descriptive  format  (for  example,
           cXtYdZ, rmt/N, server:/export/path).

     -E    Display all device error statistics.

[참고] format 명령어의 하위 명령어(inquirey)로도 확인이 가능하다.
# format

6. 파티션 정보 확인


■ prtvtoc

# prtvtoc /dev/rdsk/c0d0s2
* /dev/rdsk/c0d0s2 partition map

# df -h
Filesystem             size   used  avail capacity  Mounted on
/dev/dsk/c1d1s7        1.9G   2.0M   1.8G     1%    /export/home

특정 슬라이스(파티션)의 폴더 단위의 용량 점검

# cd /export/home
# du -sh *

   7K   hacker
   8K   lost+found 
   7K   user01


7. 여러가지 장치에 대한 확인

■ 인식된 모든 장치에 대한 목록 확인
# cat /etc/path_to_inst

■ 그래픽카드 확인
예) m64 그래픽카드라면

# prtconf | grep -i m64

(일반적인 그래픽카드 관리 명령어) : ffbconfig
해상도, 수직 주파수등을 알아 낼수 있다.
(m64 그래픽카드 관리 명령어) : m64config

# m64config –prconf

■ 네트워크 카드

# grep -i hme /etc/path_to_inst
# ifconfg -a

# cat /etc/path_to_inst | grep hme
# cat /etc/path_to_inst | grep qfe

8. CPU 정보 확인

■ psrinfo

[/]# psrinfo
0       on-line   since 10/15/2007 03:24:27

[/]# psrinfo –p


[/]# psrinfo -pv

The i386 physical processor has 1 virtual processor (0)
[/]# psrinfo -v
Status of virtual processor 0 as of: 10/15/2007 04:00:02
  on-line since 10/15/2007 03:24:27.

[참고] uname -X

9. Memroy 정보 확인

■ Physical Memory 확인(prtconf | grep Memory)

# prtconf | grep Memory
Memory size: 352 Megabytes


■ File Buffering Memory(prtmem)

File Buffering Memory는 MemTool을 이용하여 알아 볼수 있다. 결과는 다음과 같다.

# prtmem

[참고] prtmem 명령어는 솔라리스 기본 내장 명령어가 아니다. 설치 해서 사용해야 한다. 패키명은 RMCmem 이다.


■ Kernel Memory 확인(sar -k 1 1)

sar명령어를 이용하여 byte단위로 알아 볼수 있다.

# sar -k 1 1

■ Free Memory(vmstat 3)

Free Memory는 거의 항상 0 이다. 왜냐 하면 Buffer cache가 있기 때문이다.
Free Memory는 vmstat 명령어로 알아 볼수 있다.
vmstat 결과 나오는 첫번째 라인은 bootinf후 나오는평균치 이기 때문에 2번째 라인 부터 가 실질적인 결과이다.

# vmstat 3
procs memory page disk faults cpu
r b w swap free re mf pi po fr de sr f0 s2 s3 s4 in sy cs us sy id
0 0 0 81832 74792 0 12 75 4 93 0 36 0 1 1 1 265 1940 303 5 1 93


■ 각 프로세스 메모리 정보
# ps -el | more
F S   UID   PID  PPID  C PRI NI     ADDR     SZ    WCHAN TTY      TIME CMD
19 T     0     0     0  0   0 SY fec28df4      0          ?        0:03 sched
8 S     0     1     0  0  40 20 d3c11808    331 d403ee16 ?        0:00 init
19 S     0     2     0  0   0 SY d3c11108      0 fec530a0 ?        0:00 pageout
19 S     0     3     0  0   0 SY d3c10a08      0 fed0d818 ?        0:00 fsflush
8 S     0   422     1  0  40 20 d3c10308    463 d4033d68 ?        0:00 sac
SZ 필드의 값이 프로세스가 사용하고 있는 가상메모리(Virtual Memory) 총량이다. 이 안
에는 매핑된 파일과 디바이스가 포함된다. 단위는 페이지 단위로 되어 있다.(pagesize(1))

# pagesize
4096

# expr 4096 \* 564
2310144

# expr 2310144 / 1024
2256

위의 결과와 같이 약 2M(2256 Kbytes) 정도의 메모리를 사용하고 있다는 것을 알수 있다.

■ 한개의 프로세스 메모리 사용량

/]# echo $$
925
[/]# /usr/proc/bin/pmap -x 925
925:    dtksh
Address  Kbytes     RSS    Anon  Locked Mode   Mapped File
08045000      12      12       4       - rwx--    [ stack ]
08050000     532     388       -       - r-x--  dtksh
080E4000      52      52       8       - rwx--  dtksh
080F1000       8       -       -       - rwx--  dtksh
080F3000      88      84      12       - rwx--    [ heap ]
D2380000       4       4       -       - rwx--    [ anon ]
D2390000      12      12       -       - r-x--  libmp.so.2
D23A3000       4       4       -       - rwx--  libmp.so.2
D23B0000      72      56       -       - r-x--  libICE.so.6
D23D2000       4       4       -       - rwx--  libICE.so.6
D23D3000       8       -       -       - rwx--  libICE.so.6
D23E0000       4       4       4       - rwx--    [ anon ]
D23F0000      32      32       -       - r-x--  libSM.so.6
D2408000       4       4       -       - rwx--  libSM.so.6
D2410000      80      56       -       - r-x--  libXext.so.0
D2434000       4       4       -       - rwx--  libXext.so.0
..... (중략)......
D2960000     496     420       -       - r-x--  libtt.so.2
D29EC000      12      12       -       - rwx--  libtt.so.2
D2A00000     344     224       -       - r-x--  libDtSvc.so.1
D2A66000       8       8       -       - rwx--  libDtSvc.so.1
D2A68000       8       4       -       - rwx--  libDtSvc.so.1
D2A70000       4       4       4       - rwx--    [ anon ]
D2A80000     220     200       -       - r-x--  libDtWidget.so.2
D2AC8000      16      16       -       - rwx--  libDtWidget.so.2
D2ACC000       8       -       -       - rwx--  libDtWidget.so.2
D2AD0000     460      92       -       - r-x--  libDtHelp.so.1
D2B52000      28      28       -       - rwx--  libDtHelp.so.1
D2B6D000       4       4       4       - rwx--  libdl.so.1
D2B70000       4       4       -       - r--s-  dev:102,0 ino:36861
D2B80000       4       4       4       - rwx--    [ anon ]
D2B90000     324     324       -       - r-x--  ld.so.1
D2BF1000      16      16       4       - rwx--  ld.so.1
D2BF5000       8       8       4       - rwx--  ld.so.1
-------- ------- ------- ------- -------
total Kb    7092    5756      60       -

pmap명령의 결과 ksh 프로세서가 5756k의 real memory를 사용 한다는 것을 알수 있다.
60k는 시스템의 다른 프로세서와 shared한다는 것도 알수 있다.

10. 커널 모듈 정보 확인

■ sysdef | more

# sysdef | more
.....
* Hostid
* Devices
* Loadable Objects
.....

# modinfo
Id Loadaddr   Size Info Rev Module Name
  5 fe933000   3f32   1   1  specfs (filesystem for specfs)
12 fe96a962    18f   -   1  fssnap_if (File System Snapshot Interface)
..... (중략).....

# modinfo -i 5
Id Loadaddr   Size Info Rev Module Name
  5 fe933000   3f32   1   1  specfs (filesystem for specfs)

프로세스의 정보 확인
___________________________

메모리를 많이 사용하고 있는 프로세스 10개정도 확인

# ps -elf | head -1 ; ps -elf | sort -k 10 -r | head
F S      UID   PID  PPID  C PRI NI     ADDR     SZ    WCHAN    STIME TTY      TIME CMD
8 S     root   378   329  0  40 20 d461a728   4376 d4a5ce0a 10:09:27 ?        0:05 /usr/openwin/bin/Xsun :0 –nobanner
…(중략)

[참고] 사용하고 있는 메모리 계산하는 방법
메모리 사용량 = SZ * `pagesize`
예) 4376 * 4096(or 8192) = 17924096 bytes(약 17Mbytes)


11. 네트워크 정보 확인

■ netstat

1). IP 설정 확인

[/]# ifconfig -a
lo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4> mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000

(2). Routing Table 확인

[/]# netstat -nr
Routing Table: IPv4
  Destination           Gateway           Flags  Ref   Use   Interface
-------------------- -------------------- ----- ----- ------ ---------
192.168.8.0          192.168.8.2          U         1     61  pcn0
224.0.0.0            192.168.8.2          U         1      0  pcn0
default              192.168.8.254        UG        1     62 
127.0.0.1            127.0.0.1            UH       21  74190  lo0

(3). DNS Client 설정 확인

[/]# cat /etc/nsswitch.conf
......(생략).....

[/]# cat /etc/resolv.conf
nameserver 168.126.63.1

(4). 네트워크 활동량 점검

# netstat -an | more
UDP: IPv4
   Local Address         Remote Address     State
-------------------- -------------------- ------- 
      *.512                                 Idle
      *.517                                 Idle
......(중략)

# netstat -s
RAWIP
        rawipInDatagrams    =     0     rawipInErrors       =     0
        rawipInCksumErrs    =     0     rawipOutDatagrams   =     0
.....(중략)

# netstat -m (# netstat -mv)
streams allocation:
                                         cumulative  allocation
                      current   maximum       total    failures
streams                   238       272        1794           0
queues                    674       740        3895           0
mblk                      791      1270       39888           0
…(중략)

# netstat -i 2
    input   pcn0      output           input  (Total)    output
packets errs  packets errs  colls  packets errs  packets errs  colls
44725   0     44926   0     0      45538   0     45739   0     0    
11      0     11      0     0      11      0     11      0     0    
…(중략)


12. 사용자의 Disk 사용량에 대한 정보

■ quot -af

13. 서버의 모델 출력

■ prtconf -vp | grep banner-name

14. PROM Mode 현재 설정 정보 확인

■ eeprom

[출처] Solaris 정보확인 명령어|작성자 정광원

댓글 20개:

  1. A16C4
    ----
    ----
    ----
    ----
    matadorbet
    ----
    ----
    ----
    ----

    답글삭제