iftop - 윈디하나의 솔라나라
|
curses
터미널 제어라이브러리를 새롭게 만든 라이브러리가 ncurses
다. curses는 cursor optimizaion
이라는 의미다. 일반적으로 terminfo
데이터베이스를 사용한다. 솔라리스에는 curses
는 제공하지만, ncurses
는 기본 제공하지 않기 때문에 별도로 설치해야 한다.ncursesw
는 ncurses
의 와이드 캐릭터 버전이다. 쉽게 말하자면 UTF-8을 지원하는 라이브러리다. 솔라나라는 터미널 문자셋 기준이 UTF-8이기 때문에 ncursesw를 사용해야 한다.ncursesw
를 설치하면 /usr/local/share/terminfo
에 터미널 정보 데이터베이스가 설치된다. 솔라리스에는 /usr/share/lib/terminfo
가 있는데, 이보다 더 많은 터미널을 지원한다.# wget https://invisible-island.net/archives/ncurses/ncurses-6.3.tar.gz # tar xvfz ncurses-6.3.tar.gz # cd ncurses-6.3 # ./configure --with-shared --enable-widec --disable-overwrite \ --enable-sp-funcs \ --enable-term-driver \ --enable-const \ --enable-ext-colors \ --enable-ext-mouse \ --enable-ext-putwin \ --enable-no-padding \ --enable-sigwinch 1) 2) ... ** Configuration summary for NCURSES 6.3 20211021: extended funcs: yes xterm terminfo: xterm-new bin directory: /usr/local/bin lib directory: /usr/local/lib include directory: /usr/local/include/ncursesw 3) man directory: /usr/local/share/man terminfo directory: /usr/local/share/terminfo ** Include-directory is not in a standard location # make # make install1)
--disable-overwrite
파라메터 이후의 파라메터들은 확장용 파라메타다. UTF-8 지원이 가능한 ncursesw
으로 설치한다. 또한 솔라리스에서는 curses
라이브러리와 같이 사용하기 위해 --disable-overwrite
옵션을 붙인다.CFLAGS="-m64" LDFLAGS="-m64" CXXFLAGS="-m64"
옵션을 붙인다./usr/local/include/ncursesw
이다. 꼭 기억하자. 빌드할 때 initscr32
심볼은 찾을 수 없다는 오류가 발생하면 대부분 라이브러리 헤더가 잘못 삽입되었을 때 발생한다.
소스를 받아 아래와 같이 빌드하자.
windy@wl ~/src $ wget http://www.ex-parrot.com/pdw/iftop/download/iftop-1.0pre4.tar.gz
windy@wl ~/src $ tar xvfz iftop-1.0pre4.tar.gz
windy@wl ~/src $ cd iftop-1.0pre4
windy@wl ~/src/iftop-1.0pre4 $ vi options.c
#include <sys/sockio.h>
windy@wl ~/src/iftop-1.0pre4 $ ./configure CFLAGS="-m64 -I/usr/local/include -I/usr/local/include/ncursesw" LDFLAGS="-m64"
windy@wl ~/src/iftop-1.0pre4 $ make
windy@wl ~/src/iftop-1.0pre4 $ sudo make install 1)
1) 설치는 /usr/local/sbin
에 된다.
iftop -h | [-npblNBP] [-i interface] [-f filter code] [-F net/mask] [-G net6/mask6]기본 옵션
-t
에 사용할 수 있는 옵션
자세한 사항은 iftop(8)을 읽어보자.
iftop 의 원래 화면 출력은 아래와 같다.
windy@wl ~ $ sudo /usr/local/sbin/iftop 195Kb 391Kb 586Kb 781Kb 977Kb └───────────────┴───────────────┴───────────────┴───────────────┴─────────────── wl => 0.0.0.0 123Kb 37.9Kb 37.9Kb <= 152Kb 64.3Kb 64.3Kb ──────────────────────────────────────────────────────────────────────────────── TX: cum: 58.4KB peak: 127Kb rates: 127Kb 46.7Kb 46.7Kb RX: 81.4KB 171Kb 153Kb 65.1Kb 65.1Kb TOTAL: 140KB 281Kb 281Kb 112Kb 112Kb
만약 Putty에서 아래와 같이 출력된다면 (ACS 인식 문제로 라인 출력이 비정상적인 경우) Putty 옵션에서 라인 그리기 옵션 (Window - Translation - Enable VT100 line drawing even in UTF-8 mode
)을 활성화 한다. 이 옵션은 Putty 0.71 부터 지원된다.
195Kb 391Kb 586Kb 781Kb 977Kb
mqqqqqqqqqqqqqqqvqqqqqqqqqqqqqqqvqqqqqqqqqqqqqqqvqqqqqqqqqqqqqqqvqqqqqqqqqqqqqqq
wl => 0.0.0.0 123Kb 37.9Kb 37.9Kb
<= 152Kb 64.3Kb 64.3Kb
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
TX: cum: 58.4KB peak: 127Kb rates: 127Kb 46.7Kb 46.7Kb
RX: 81.4KB 171Kb 153Kb 65.1Kb 65.1Kb
TOTAL: 140KB 281Kb 281Kb 112Kb 112Kb
RSS ATOM XHTML 5 CSS3 |
Copyright © 2004-2023 Jo HoSeok. All rights reserved. |