아림이의 라이프~~~~!!!

리눅스 서버 본문

카테고리 없음

리눅스 서버

아이린84 2017. 12. 1. 20:47


작성자: 강명규(kang@dbakorea.pe.kr)
작성일: 2001-08-03
수정일: 2001-09-06(2.0버전에 맞게 변경)
OS:     Linux 2.2.14


사이트: www.ntop.org

ntop은 네트웍에서 사용되는 top과 같다고 보면 된다.
항상 그렇듯이 말로 설명해봐야 별 도움이 안된다. 특히 모니터링툴들은..
직접 따라해보자

우선 ntop을 받아온다.
www.ntop.org에 가서 직접 받아도 되고(소스는 snapshot.ntop.org에 있다고 하나 현재는 서비스되고 있지 않았다.),
미러 ftp에서 받아도 된다. 사이트가 속도가 느리므로(나는 그랬다) 미러사이트에서 받는것이 좋을 것 같다.
현재 최신버전은 2.0beta지만, 미러사이트에는 1.1버전이 있다.

최신버전: http://luca.ntop.org/ntop-2.0beta1.tgz

항상 최신 버전에 고집하는 나의 성격상 2.0을 포기하고 1.1버전을 사용할 생각은 없다. ^^
2.0버전을 설치하는 것으로 하겠다.

1.1대의 간략한 설명
미러사이트에서 rpm형식의 ntop이 있으므로 rpm -ivh ntop-1.1-1.rh6.i386.rpm 를 해주면 끝난다.
쉘에서 ntop을 입력하면 되고 해당 명령어는 다음과 같다.
ntop실행중에 아래의 키를 누르면 된다. 'h'를 누르면 help가 표시된다.

While ntop is running interactively, the following keys are active:
       'q' - quit ntop
       'r' - reset statistics
       'n' - toggle address format (num <-> sym <-> MAC <-> Nw Board Manufact.)
       'p' - toggle traffic values (bytes <-> % <-> thpt)
       'l' - toggle hosts display (local subnet <-> all)
       'd' - toggle idle (idle <-> send/receive)
       't' - toggle sort (sent <-> received)
       'y' - toggle columns sort
       'h' - show this help
       ' ' - toggle protocol

설치하기
일단 ntop패키지를 풀고 나서 docs디렉토리의 vi BUILD-NTOP.txt 파일에 설치설명이 있다.
다음의 패키지가 필수적으로 필요하다. 이 패키지 설치의 설명은 생략하겠다.

   - gdbm       http://www.gnu.org/
   - libpcap    http://www.tcpdump.org/

[root@dev2 /down]# tar xvzf ntop-2.0beta1.tgz -C /usr/local/src
[root@dev2 /down]$ cd /usr/local/src/gdchart0.94c/
[root@dev2 gdchart0.94c]$ ./configure
[root@dev2 gdchart0.94c]# cd gd-1.8.3/libpng-1.0.8/
[root@dev2 libpng-1.0.8]# cp scripts/makefile.linux Makefile
[root@dev2 libpng-1.0.8]# make
[root@dev2 libpng-1.0.8]# cd ../../zlib-1.1.3/
[root@dev2 zlib-1.1.3]# ./configure
[root@dev2 zlib-1.1.3]# make
[root@dev2 zlib-1.1.3]# cd ..
[root@dev2 gdchart0.94c]# make
[root@dev2 gdchart0.94c]# cd ../ntop/
[root@dev2 ntop]# ./configure
[root@dev2 ntop]# make
[root@dev2 ntop]# make install



사용하기
ntop은 2가지 모드로 실행될 수 있다.

terminal mode
web mode

일단 interactive모드로 실행해 보자 <= expire 2.0버전부터 interactive모드가 없어졌다.
[root@dev2 docs]# intop -i eth0

-- intop 0.0.1 (Sep 10 2001) -- The first interactive ntop program.
(C) Copyright 2000 L. Deri and R. Carbone. All rights reserved.

It allows you to control the power of ntop using fingers rather than mouse!

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

Initializing ntop engine.... Please wait.
starting sniffer on eth0 (with no filter enabled)...

Type ? for help.


intop@eth0> ?
Commands enclosed in '<>' are not yet implemented.
Commands may be abbreviated. Commands are:

 ?              <warranty>       filter          swap            nbt 
 help           <copying>        sniff           top            <dump>
 exit            history         uptime          lsdev          <last>
 quit            open           <hash>           hosts          <nslookup>
 prompt         <close>          info            arp              
intop@eth0> top

                  intop 0.0.1 (Sep 10 2001) listening on [eth0]
103 Pkts/10.4 Kb [IP 8.9 Kb/Other 1.5 Kb]                      Thpt: 0.0 /0.0 
 Host                     Act   -Rcvd-      Sent       TCP       UDP     ICMP 
 dev2                      B    4.3 Kb    3.6 Kb    1.2 Kb    3.1 Kb        0
 211.41.23.234             B    1.8 Kb    1.3 Kb    1.8 Kb         0        0
 211.41.23.157             B        62        62        62         0        0
 211.41.23.63              B        62       327        62         0        0
 211.41.23.153             S         0        46         0         0        0
 211.41.23.39              S         0        46         0         0        0
 211.41.23.175             S         0       400         0         0        0
 211.41.23.95              S         0        46         0         0        0
 211.41.23.141             S         0        46         0         0        0
 211.41.23.74              S         0        46         0         0        0
 211.41.23.125             S         0       336         0         0        0
 211.41.23.223             S         0        46         0         0        0
 211.41.23.181             S         0        46         0         0        0
 211.41.23.49              S         0        46         0         0        0
 211.41.23.171             S         0        46         0         0        0
 211.41.23.1               S         0        92         0         0        0
 211.41.23.236             S         0        46         0         0        0
 211.41.23.186             S         0       243         0         0        0
 211.41.23.122             S         0        46         0         0        0
 211.41.23.190             S         0        46         0         0        0

intop@eth0> quit
Thanks for using 'intop'.
[root@dev2 docs]# 

나머지 명령들에 대해선 각자 알아보시도록..
IP가 나오니까 보안상(?-.-) 더 표시하기가 그러네요

web모드
[root@dev2 html]# ntop -W 0 -w 8081 -m 211.41.23.234/24
http://localhost:8081/

웹모드는 로컬컴퓨터에서만 접근가능했는데 신뢰된 IP에 대해 open되는 부분은
나중에 추가하겠습니다. 가능한건가 몰라.. 정말 추가할까.. -.-


수정(2001-11-06)
2.0버전부터 Interactive모드가 없어졌다.
웹으로 보는 것을 설명하겠다.

다음과 같이 기동한다.
데몬으로 띄우고, 웹에서 3000포트로 사용하겠다는 뜻이다.
[root@ns /root]# ntop -d -w 3000
Wait please: ntop is coming up...
07/Nov/2001:00:04:27 Initializing IP services...
07/Nov/2001:00:04:28 Parsing command line options...
07/Nov/2001:00:04:28 SSL is present but https is disabled: use -W  for enabling it
07/Nov/2001:00:04:28 Initializing SSL...
[root@ns /root]# 07/Nov/2001:00:04:28 Bye bye: I'm becoming a daemon...

웹에서 다음과 같이 주소를 입력한다.
그러면 아주 보기 좋은 화면이 나타날 것이다.

http://dbakorea.pe.kr:3000

 

Comments