Linux下流量 监控/统计 工具 vnstat 安装&使用

使用环境

Ubuntu

安装

apt install vnstat

命令行参数

root@www:~# vnstat --help
vnStat 2.6 by Teemu Toivola <tst at iki dot fi>

      -5,  --fiveminutes [limit]   show 5 minutes
      -h,  --hours [limit]         show hours
      -hg, --hoursgraph            show hours graph
      -d,  --days [limit]          show days
      -m,  --months [limit]        show months
      -y,  --years [limit]         show years
      -t,  --top [limit]           show top days

      -b, --begin <date>           set list begin date
      -e, --end <date>             set list end date

      --oneline [mode]             show simple parsable format
      --json [mode] [limit]        show database in json format
      --xml [mode] [limit]         show database in xml format

      -tr, --traffic [time]        calculate traffic
      -l,  --live [mode]           show transfer rate in real time
      -i,  --iface <interface>     select interface

Use "--longhelp" or "man vnstat" for complete list of options.

使用示例

➜  ~ vnstat -m

 eth0  /  monthly

       month        rx      |     tx      |    total    |   avg. rate
    ------------------------+-------------+-------------+---------------
      Feb '21    996.99 GiB |  244.07 GiB |    1.21 TiB |    4.41 Mbit/s
      Mar '21    417.35 GiB |    2.63 TiB |    3.04 TiB |    9.97 Mbit/s
      Apr '21     67.18 GiB |   29.35 GiB |   96.53 GiB |  319.90 kbit/s
      May '21     85.16 GiB |   28.83 GiB |  113.99 GiB |  365.57 kbit/s
      Jun '21     60.51 GiB |   30.36 GiB |   90.86 GiB |  301.12 kbit/s
      Jul '21    131.62 GiB |   61.58 GiB |  193.21 GiB |  619.63 kbit/s
      Aug '21     90.68 GiB |   42.77 GiB |  133.45 GiB |  427.99 kbit/s
      Sep '21    121.96 GiB |   52.30 GiB |  174.26 GiB |  577.49 kbit/s
      Oct '21    146.16 GiB |   98.65 GiB |  244.81 GiB |  785.14 kbit/s
      Nov '21    479.38 GiB |  289.77 GiB |  769.16 GiB |    2.55 Mbit/s
      Dec '21    214.34 GiB |  330.32 GiB |  544.66 GiB |    1.75 Mbit/s
      Jan '22     38.65 GiB |   52.28 GiB |   90.93 GiB |    2.86 Mbit/s
    ------------------------+-------------+-------------+---------------
    estimated    379.69 GiB |  513.53 GiB |  893.22 GiB |

这篇文章有用吗?

点击星号为它评分!

平均评分 0 / 5. 投票数: 0

到目前为止还没有投票!成为第一位评论此文章。

发表评论