nload是一款监控网卡流量的工具,小巧灵便,很实用,只是功能较为单一,下面做一下简单的安装以及使用介绍:
安装过程:
wget http://www.roland-riegel.de/nload/nload-0.7.2.tar.gz
--10:05:03-- http://www.roland-riegel.de/nload/nload-0.7.2.tar.gzResolving www.roland-riegel.de... 109.239.57.139Connecting to www.roland-riegel.de|109.239.57.139|:80... connected.HTTP request sent, awaiting response... 200 OKLength: 145262 (142K) [application/x-gzip]Saving to: `nload-0.7.2.tar.gz'100%[========================================>] 145,262 118K/s in 1.2s 10:05:08 (118 KB/s) - `nload-0.7.2.tar.gz' saved [145262/145262]
tar -zxvf nload-0.7.2.tar.gz /tools
........................... nload-0.7.2/src/opt_window.h nload-0.7.2/src/setting.cpp nload-0.7.2/src/screen.cpp nload-0.7.2/src/devreaderfactory.h nload-0.7.2/src/form_field.cpp nload-0.7.2/src/devreader-linux-proc.h nload-0.7.2/src/settingstore.h nload-0.7.2/configure.in nload-0.7.2/COPYING nload-0.7.2/missing nload-0.7.2/config.guess nload-0.7.2/Makefile.in nload-0.7.2/nload.spec.in nload-0.7.2/config.sub nload-0.7.2/README
cd /tools/nload-0.7.2
./configure
................................... checking for sys/ioctl.h... yes checking arpa/inet.h usability... yes checking arpa/inet.h presence... yes checking for arpa/inet.h... yes checking netinet/in.h usability... yes checking netinet/in.h presence... yes checking for netinet/in.h... yes checking for an ANSI C-conforming const... yes checking for size_t... yes checking whether time.h and sys/time.h may both be included... yes checking return type of signal handlers... void checking for gettimeofday... yes checking for inet_ntoa... yes checking for socket... yes configure: creating ./config.status config.status: creating Makefile config.status: creating nload.spec config.status: creating docs/Makefile config.status: creating docs/nload.1 config.status: creating src/Makefile config.status: creating config.h config.status: executing depfiles commands 如果有报错,可能缺少依赖包,yum安装相关包组:
yum install gcc gcc-c++ ncurses-devel
再次进行检测 ./configure,通过后,进行下一步:
make && make install
....................................... make[2]: Nothing to be done for `all-am'.make[2]: Leaving directory `/tools/nload-0.7.2'make[1]: Leaving directory `/tools/nload-0.7.2'Making install in docsmake[1]: Entering directory `/tools/nload-0.7.2/docs'/bin/sh /tools/nload-0.7.2/install-sh -d /usr/local/share/man/man1/usr/bin/install -c -m 644 ../docs/nload.1 /usr/local/share/man/man1 gzip -f /usr/local/share/man/man1/nload.1 make[1]: Leaving directory `/tools/nload-0.7.2/docs' Making install in src make[1]: Entering directory `/tools/nload-0.7.2/src' make[2]: Entering directory `/tools/nload-0.7.2/src' test -z "/usr/local/bin" || /bin/mkdir -p "/usr/local/bin" /usr/bin/install -c 'nload' '/usr/local/bin/nload' make[2]: Nothing to be done for `install-data-am'. make[2]: Leaving directory `/tools/nload-0.7.2/src' make[1]: Leaving directory `/tools/nload-0.7.2/src' make[1]: Entering directory `/tools/nload-0.7.2' make[2]: Entering directory `/tools/nload-0.7.2' make[2]: Nothing to be done for `install-exec-am'. make[2]: Nothing to be done for `install-data-am'. make[2]: Leaving directory `/tools/nload-0.7.2' make[1]: Leaving directory `/tools/nload-0.7.2
常用参数组合介绍:
安装完毕,直接输入nload命令就可以使用,也可以配合诸多参数进行自定义调节,常用参数如下:
1 -u设置屏显网卡带宽单位,子参数分别表示:
b: Bit/s, k: kBit/s, m: MBit/s etc.
B: Byte/s, K: kByte/s, M: MByte/s etc
nload -u m
Device eth1 [192.168.1.2] (2/4):
=================================================================================
Incoming:
Curr: 0.02 MBit/s
Avg: 0.03 MBit/s Min: 0.00 MBit/s Max: 0.13 MBit/s Ttl: 42.74 GBytenload -u b
Device eth1 [192.168.1.2] (2/4):
=================================================================================Incoming:
Curr: 95872.00 Bit/s
Avg: 83840.00 Bit/s
Min: 472.00 Bit/s Max: 311112.00 Bit/s .. Ttl: 15.26 GByte
2 -t 设置屏显刷新时间,单位是毫秒,默认值是500
nload -t 800
3 -m 显示所有网卡占用带宽情况,即时消息,如果有多块网卡,一屏显示不完,可以使用左右键切换到其他屏
nload -m
Device eth0 [166.80.64.15] (1/4):
=================================================================================Incoming: Outgoing:Curr: 2.31 kBit/s Curr: 0.00 Bit/sAvg: 7.02 kBit/s Avg: 10.38 kBit/sMin: 1.84 kBit/s Min: 0.00 Bit/sMax: 14.72 kBit/s Max: 23.93 kBit/sTtl: 15.26 GByte Ttl: 21.68 GByteDevice eth1 [192.168.1.2] (2/4):
=================================================================================Incoming: Outgoing:Curr: 53.98 kBit/s Curr: 0.80 kBit/sAvg: 19.45 kBit/s Avg: 0.22 kBit/sMin: 6.45 kBit/s Min: 15.11 kBit/sMax: 53.98 kBit/s Max: 0.80 kBit/sTtl: 42.74 GByte Ttl: 468.94 GByteDevice lo [127.0.0.1] (3/4):
=================================================================================Incoming: Outgoing:Curr: 0.00 Bit/s Curr: 0.00 Bit/sAvg: 0.00 Bit/s Avg: 0.00 Bit/sMin: 0.00 Bit/s Min: 0.00 Bit/sMax: 0.00 Bit/s Max: 0.00 Bit/sTtl: 603.05 MByte Ttl: 603.05 MByte
详尽参数:
-a-----------period Sets the length in seconds of the time window for average calculation.
-i --------- ---max_scaling Specifies the 100% mark in kBit/s of the graph indicating the
incoming bandwidth usage. Ignored if max_scaling is 0 or the switch -m is given. -m --------- Show multiple devices at a time; no traffic graphs.
-o ------------max_scaling Same as -i but for the graph indicating the outgoing bandwidth usage. -t --------- interval Determines the refresh interval of the display in milliseconds. -u h|b|k|m|g --------- Sets the type of unit used for the display of traffic numbers. H|B|K|M|G h: auto, b: Bit/s, k: kBit/s, m: MBit/s etc. H: auto, B: Byte/s, K: kByte/s, M: MByte/s etc. -U h|b|k|m|g--------- Same as -u, but for a total amount of data (without "/s"). H|B|K|M|G devices Network devices to use. Default is to use all auto-detected devices.-h--------- Print this help.