歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Centos下實時查看網卡流量的工具 – nload

Centos下實時查看網卡流量的工具 – nload

日期:2017/2/27 15:59:23   编辑:Linux教程
在 FreeBSD 下,安裝 nload 很簡單,可以使用 ports 進行安裝,位置在 /usr/ports/net/nload

也可以基於源代碼進行編譯安裝。

nload 的官方網站為: http://www.roland-riegel.de/nload/
在 CentOS 下,nload 目前就只能基於源代碼進行編譯安裝了。默認安裝的 CentOS ,要編譯安裝 nload 時,可能還需要安裝幾個需要的軟件包:gcc 、gcc-c++ 和 ncurses-devel
# yum install gcc gcc-c++ ncurses-devel
# wget http://www.roland-riegel.de/nload/nload-0.7.2.tar.gz
# tar -xzvf nload-0.7.2.tar.gz & cd nload-0.7.2
# ./configure & make
# make install

完成後,nload 被安裝在了 /usr/local/bin/nload
nload version 0.7.2

Copyright (C) 2001 – 2008 by Roland Riegel
nload comes with ABSOLUTELY NO WARRANTY. This is free software, and you are
welcome to redistribute it under certain conditions. For more details see the
GNU General Public License Version 2 ( http://www.gnu.org/copyleft/gpl.html ).

Command line syntax:
nload [options] [devices]
nload –help|-h

Options:
-a period Sets the length in seconds of the time window for average
calculation.
Default is 300.
-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.
Default is 10240.
-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.
Default is 10240.
-t interval Determines the refresh interval of the display in milliseconds.
Default is 500.
-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.
Default is h.
-U h|b|k|m|g Same as -u, but for a total amount of data (without “/s”).
H|B|K|M|G Default is H.
devices Network devices to use.
Default is to use all auto-detected devices.
–help
-h Print this help.

example: nload -t 200 -i 256 -o 256 -U M
使用 $ nload eth0 ,可以查看第一網卡的流量情況,顯示的是實時的流量圖, $ nload -m 可以同時查看多個網卡的流量情況。

實時查看網卡流量的工具除了 nload 之外,還有 slurm 以及 systat 等。
Copyright © Linux教程網 All Rights Reserved