如何取得 TB 級的 ubuntu 網路介面統計資料?

如何取得 TB 級的 ubuntu 網路介面統計資料?

當我使用其中一個查詢伺服器的網路介面統計資料時,ifconfig它們ip -s被限制為 999GB,然後滾動到 0GB,重新開始。是否可以以某種方式更改配置以允許統計資料記錄在 TB 範圍內?或使用不同的日誌工具?我使用的是 Ubuntu 20.04。

$ uname -p
x86_64

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.1 LTS
Release:        20.04
Codename:       focal

非常感謝。

編輯以新增請求的資訊。enp4s0是我的防火牆的 LAN 端,總數最近才重設回 0GB。我會在適當的時候提供更新。

ifconfig 輸出:

$ ifconfig enp4s0
enp4s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.54.141  netmask 255.255.255.0  broadcast 192.168.54.255
        ether 00:26:2d:24:91:43  txqueuelen 1000  (Ethernet)
        RX packets 47559414  bytes 8105358582 (8.1 GB)
        RX errors 0  dropped 9  overruns 0  frame 0
        TX packets 126168339  bytes 183503412184 (183.5 GB)
        TX errors 1  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 18

ip 輸出:

$ ip -s -h link show enp4s0
4: enp4s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
    link/ether 00:26:2d:24:91:43 brd ff:ff:ff:ff:ff:ff
    RX: bytes  packets  errors  dropped overrun mcast
    8.11G      47.6M    0       9       0       3.38k
    TX: bytes  packets  errors  dropped carrier collsns
    184G       126M     1       0       0       0

答案1

ifconfig和都ip根據要顯示的資料量以適當的單位顯示統計資料。能否提供顯示單位翻轉前後的輸出?

以下是 Ubuntu 16.04.4 x86_64 伺服器的輸出:

$ lsb_release -a
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.4 LTS
Release:        16.04
Codename:       xenial

$ uname -p
x86_64

ifconfig 輸出

$ ifconfig enp94s0f1
enp94s0f1 Link encap:Ethernet  HWaddr 28:ac:9e:e7:a9:cd  
          inet addr:196.196.195.10  Bcast:196.196.195.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:11694856562 errors:0 dropped:38446 overruns:0 frame:0
          TX packets:10658263823 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:6448839112903 (6.4 TB)  TX bytes:4392568782445 (4.3 TB)

ip輸出

$ ip -s -h link show enp94s0f1
3: enp94s0f1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
    link/ether 28:ac:9e:e7:a9:cd brd ff:ff:ff:ff:ff:ff
    RX: bytes  packets  errors  dropped overrun mcast   
    6.45T      11.7G    0       38.4k   0       0       
    TX: bytes  packets  errors  dropped carrier collsns 
    4.39T      10.7G    0       0       0       0 

相關內容