I want to get total amount of TX and RX to know the amount of data the server is receiving or transmitting at a moment.
With this command ip -s link
I get this result
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
RX: bytes packets errors dropped overrun mcast
21914963679042 3114955121 0 0 0 0
TX: bytes packets errors dropped carrier collsns
21914963679042 3114955121 0 0 0 0
2: enp3s0f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
link/ether d4:5d:64:40:53:ca brd ff:ff:ff:ff:ff:ff
RX: bytes packets errors dropped overrun mcast
251928745868 1094612700 0 0 0 5914052
TX: bytes packets errors dropped carrier collsns
1091337709507 1328468566 0 0 0 0
3: enp3s0f1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
link/ether d4:5d:64:40:53:cb brd ff:ff:ff:ff:ff:ff
RX: bytes packets errors dropped overrun mcast
0 0 0 0 0 0
TX: bytes packets errors dropped carrier collsns
0 0 0 0 0 0
As far as I know, lo
is local. So must be ignored. But I need to get the sum of TX an RX of remaining interfaces. How can it be done?
Thanks.