os/Linux

리눅스 관리를 위해서 알아햐할 모니터링 툴 20

C/H 2010. 7. 15. 17:08
  • top - 프로세스 상태How do I Find Out Linux CPU Utilization?
    • t : 요약 정보 on/off.
    • m : 메모리 정보 on/off.
    • A : 시스템 리소별 정렬기능 on/off.
    • f : 화면상단에 대화식 입력으로 특정 화면구성가능.
    • o : 화명상단에 대화식 입력화면을 보여준다.
    • r : 이슈 renice 명령.
    • k : 이슈 킬 명령.
    • z : 컬러/모노 on/off

    - bmon, iftop, etherApe, iptraf 툴

  • vmstat - 시스템 활동상태, 하드웨어 및 시스템 정보
    How do I find out Linux Resource utilization to detect system bottlenecks?
    vmstat 3
    vmstat -m //Display Memory Utilization Slabinfo
    vmstat -a //Get Information About Active / Inactive Memory Pages
    Sample
    procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------
     r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
     0  0      0 2540988 522188 5130400    0    0     2    32    4    2  4  1 96  0  0
     1  0      0 2540988 522188 5130400    0    0     0   720 1199  665  1  0 99  0  0
     0  0      0 2540956 522188 5130400    0    0     0     0 1151 1569  4  1 95  0  0
     0  0      0 2540956 522188 5130500    0    0     0     6 1117  439  1  0 99  0  0
     0  0      0 2540940 522188 5130512    0    0     0   536 1189  932  1  0 98  0  0
     0  0      0 2538444 522188 5130588    0    0     0     0 1187 1417  4  1 96  0  0
     0  0      0 2490060 522188 5130640    0    0     0    18 1253 1123  5  1 94  0  0
  • w - 로그인 사용자와 활동상태
    w
    w username
    w vivek


    Sample
    17:58:47 up 5 days, 20:28,  2 users,  load average: 0.36, 0.26, 0.24
    USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT
    root     pts/0    10.1.3.145       14:55    5.00s  0.04s  0.02s vim /etc/resolv.conf
    root     pts/1    10.1.3.145       17:43    0.00s  0.03s  0.00s w
  • uptime - 얼마나 오래동안 시스템이 가동되었는가
    uptime


    Sample
    18:02:41 up 41 days, 23:42,  1 user,  load average: 0.00, 0.00, 0.00
  • ps - 프로세스 표시
    ps -A
    
    ps -AI 
    # Show Long Format Output
    
    ps -AIF
    # To turn on extra full mode (it will show command line arguments passed to process):
    
    ps -AIFH
    # To See Threads ( LWP and NLWP)
    
    ps -AILm
    # To See Threads After Processes
    
    ps -ax
    ps -axu
    # Print All Process On The Server
    
    ps -ejH
    ps axjf
    pstree
    # Print A Process Tree
    
    ps -eo euser,ruser,suser,fuser,f,comm,label
    ps axZ
    ps -eM
    # Print Security Information
    
    ps -U vivek -u vivek u 
    # See Every Process Running As User Vivek
    
    ps -eo pid,tid,class,rtprio,ni,pri,psr,pcpu,stat,wchan:14,comm
    ps axo stat,euid,ruid,tty,tpgid,sess,pgrp,ppid,pid,pcpu,comm
    ps -eopid,tt,user,fname,tmout,f,wchan
    # Set Output In a User-Defined Format
    
    ps -C lighttpd -o pid= 
    # Display Only The Process IDs of Lighttpd
    
    pgrep lighttpd 
    # OR
    
    pgrep -u vivek php-cgi 
    # OR
    
    ps -p 55977 -o comm= 
    # Display The Name of PID 55977
    
    ps -auxf | sort -nr -k 4 | head -10 
    # Find Out The Top 10 Memory Consuming Process
    
    ps -auxf | sort -nr -k 3 | head -10 # Find Out top 10 CPU Consuming Process
    
    ps -elf | grep apache


    Sample
    PID TTY          TIME CMD
        1 ?        00:00:02 init
        2 ?        00:00:02 migration/0
        3 ?        00:00:01 ksoftirqd/0
        4 ?        00:00:00 watchdog/0
        5 ?        00:00:00 migration/1
        6 ?        00:00:15 ksoftirqd/1
    ....
    .....
     4881 ?        00:53:28 java
     4885 tty1     00:00:00 mingetty
     4886 tty2     00:00:00 mingetty
     4887 tty3     00:00:00 mingetty
     4888 tty4     00:00:00 mingetty
     4891 tty5     00:00:00 mingetty
     4892 tty6     00:00:00 mingetty
     4893 ttyS1    00:00:00 agetty
    12853 ?        00:00:00 cifsoplockd
    12854 ?        00:00:00 cifsdnotifyd
    14231 ?        00:10:34 lighttpd
    14232 ?        00:00:00 php-cgi
    54981 pts/0    00:00:00 vim
    55465 ?        00:00:00 php-cgi
    55546 ?        00:00:00 bind9-snmp-stat
    55704 pts/1    00:00:00 ps
  • free - 메모리 사용 Linux Find Out Virtual Memory PAGESIZE
    Linux Limit CPU Usage Per Process
    How much RAM does my Ubuntu / Fedora Linux desktop PC have?
    Sample
                total       used       free     shared    buffers     cached
    Mem:      12302896    9739664    2563232          0     523124    5154740
    -/+ buffers/cache:    4061800    8241096
    Swap:      1052248          0    1052248
  • iostat - 평균 CPU 부하, 디스크 활동
    Linux Track NFS Directory / Disk I/O Stats
    iostat


    Sample
    Linux 2.6.18-128.1.14.el5 (www03.nixcraft.in) 	06/26/2009
    
    avg-cpu:  %user   %nice %system %iowait  %steal   %idle
               3.50    0.09    0.51    0.03    0.00   95.86
    
    Device:            tps   Blk_read/s   Blk_wrtn/s   Blk_read   Blk_wrtn
    sda              22.04        31.88       512.03   16193351  260102868
    sda1              0.00         0.00         0.00       2166        180
    sda2             22.04        31.87       512.03   16189010  260102688
    sda3              0.00         0.00         0.00       1615          0
  • sar - 시스템활동 수집 및 보고Howto collect Linux system utilization data into a file
    sar -n DEV | more
    sar -n DEV -f /var/log/sa/sa24 | more
    sar 4 5


    Sample
    Linux 2.6.18-128.1.14.el5 (www03.nixcraft.in) 		06/26/2009
    
    06:45:12 PM       CPU     %user     %nice   %system   %iowait    %steal     %idle
    06:45:16 PM       all      2.00      0.00      0.22      0.00      0.00     97.78
    06:45:20 PM       all      2.07      0.00      0.38      0.03      0.00     97.52
    06:45:24 PM       all      0.94      0.00      0.28      0.00      0.00     98.78
    06:45:28 PM       all      1.56      0.00      0.22      0.00      0.00     98.22
    06:45:32 PM       all      3.53      0.00      0.25      0.03      0.00     96.19
    Average:          all      2.02      0.00      0.27      0.01      0.00     97.70
  • mpstat - Multiprocessor 사용
    Linux display each multiple SMP CPU processors utilization individually
    mpstat -P ALL

    Sample
    Linux 2.6.18-128.1.14.el5 (www03.nixcraft.in)	 	06/26/2009
    
    06:48:11 PM  CPU   %user   %nice    %sys %iowait    %irq   %soft  %steal   %idle    intr/s
    06:48:11 PM  all    3.50    0.09    0.34    0.03    0.01    0.17    0.00   95.86   1218.04
    06:48:11 PM    0    3.44    0.08    0.31    0.02    0.00    0.12    0.00   96.04   1000.31
    06:48:11 PM    1    3.10    0.08    0.32    0.09    0.02    0.11    0.00   96.28     34.93
    06:48:11 PM    2    4.16    0.11    0.36    0.02    0.00    0.11    0.00   95.25      0.00
    06:48:11 PM    3    3.77    0.11    0.38    0.03    0.01    0.24    0.00   95.46     44.80
    06:48:11 PM    4    2.96    0.07    0.29    0.04    0.02    0.10    0.00   96.52     25.91
    06:48:11 PM    5    3.26    0.08    0.28    0.03    0.01    0.10    0.00   96.23     14.98
    06:48:11 PM    6    4.00    0.10    0.34    0.01    0.00    0.13    0.00   95.42      3.75
    06:48:11 PM    7    3.30    0.11    0.39    0.03    0.01    0.46    0.00   95.69     76.89
  • pmap - Process Memory Usage
    Linux find the memory used by a program / process using pmap command
    pmap -d PID
    pmap -d 47394



    Performance Engineering and Capacity Planning ...

    이미지출처 : dsstos.blogspot.com


  • netstat and ss - Network Statistics
    ss: Display Linux TCP / UDP Network and Socket Information
    Get Detailed Information About Particular IP address Connections Using netstat Command
    netstat 네트워크 연결, 라우팅 테이블, 인터페이스 통계, masquerade 연결, 멀티 캐스트 및 구성원을 표시
    ss 소켓 통계를 덤프


    I Got Hacked: Intrusion Detection tools

    이미지출처 : elamb.org



  • iptraf - Real-time Network Statistics화려한 인터랙티브의 IP 랜 모니터.
    이더넷로드 정보, 노드 통계는 TCP 정보,의 UDP 카운트, ICMP의 및 OSPF 정보를 포함하여 다양한 네트워크 통계를 생성 및 ncurses 기반의 IP 랜 모니터입니다,의 IP 체크섬 오류 및 기타. 그것은 형식을 읽기 쉽게 제공합니다

    IPTraf User's Manual

    이미지출처 : iptraf.seul.org


반응형