10
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Linuxで通信量を監視する

Posted at

前の記事でディスク容量を監視してみました。
ついでに、通信量を測定してみたかったので、watchコマンドにifconfigを渡してみた。

$ watch -n 1 ifconfig enx00e04c00004a

こんな感じ。enx~はインターフェース名。書かなければ全部出てきます。
通信量は起動してからの受信量・送信量がそれぞれRX、TXとして表示されます。詳細はifconfigのマニュアル見てね。

Every 0.1s: ifconfig enx00e04c00004a                       graviohub: Thu Sep 10 14:57:45 2020

enx00e04c00004a: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.86.55  netmask 255.255.255.0  broadcast 192.168.86.255
        inet6 fe80::79b8:173:d2bd:f0e9  prefixlen 64  scopeid 0x20<link>
        ether 00:e0:4c:00:00:4a  txqueuelen 1000  (Ethernet)
        RX packets 2500640  bytes 1823881816 (1.8 GB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 3509207  bytes 1042507689 (1.0 GB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

このやり方もかなりお手軽なのでおすすめです。きちんと測定したいときはそれなりのやり方を考えましょう。:P

watch-ifconfig.gif

10
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?