かっこ良くネットワークトラフィックを監視!『Speedometer』コマンド
今回は、ネットワークトラフィックをかっこよくモニタリング出来るツール『Speedometer』コマンドを紹介する。
1.インストール
以下のコマンドを実行し、インストールを行う。
●Debian/Ubuntuの場合
$ sudo apt-get install speedometer
●RHEL系の場合
$ yum install python-urwid $ wget http://excess.org/speedometer/speedometer-2.8.tar.gz $ tar -xvzf speedometer-2.8.tar.gz $ cp speedometer.py /usr/local/bin/speedometer $ chown root: /usr/local/bin/speedometer $ chmod 755 /usr/local/bin/speedometer
これでインストールが完了する。
2.コマンドの実行
さて、それでは実際にコマンドを実行してみよう。
まずはオプション無しで実行する。
$ speedometer Usage: speedometer [options] tap [[-c] tap]... Monitor network traffic or speed/progress of a file transfer. At least one tap must be entered. -c starts a new column, otherwise taps are piled vertically. Taps: -f filename [size] display download speed [with progress bar] -r network-interface display bytes received on network-interface -t network-interface display bytes transmitted on network-interface -c start a new column for following tap arguments Options: -b use old blocky display instead of smoothed display even when UTF-8 encoding is detected (use this if you see strange characters) -i interval-in-seconds eg. "5" or "0.25" default: "1" -k (1|16|88|256) set the number of colors this terminal supports (default 16) -l use linear charts instead of logarithmic you will VERY LIKELY want to set -m as well -m chart-maximum set the maximum bytes/second displayed on the chart (default 2^32) -n chart-minimum set the minimum bytes/second displayed on the chart (default 32) -p use original plain-text display (one tap only) -s use bits/s instead of bytes/s -x exit when files reach their expected size -z report zero size on files that don't exist instead of waiting for them to be created Note: -rx and -tx are accepted as aliases for -r and -t for compatibility with earlier releases of speedometer. -f may be also omitted for similar reasons. Python Version: 2.7 Urwid >= 0.9.9.1 detected: yes UTF-8 encoding detected: yes
オプション無しの場合、ヘルプの内容が表示されるだけのようだ。
まず、受信バイト数を表示させる。
$ speedometer -rx eth0
次に、送信バイト数を確認する。
$ speedometer -tx eth0
同時に表示させるには、以下のように実行する。
$ speedometer -tx eth0 -rx eth0
列を分けて表示させる場合は、「-c」で列を分ける事が出来る。
以下では、NIC「lo」とNIC「eth0」で列を分けて表示させている。
$ speedometer -tx lo -rx lo -c -tx eth0 -rx eth0
うーむ、これはいいね。