
On Wed, 2 Sep 2020 19:23:37 +1200, Peter Reutemann wrote:
On my desktop, I find the network traffic monitor in my taskbar rather handy to check throughput and whether a large transfer across the network has finished. However, I've always wanted to have an alternative for the console.
This is why I wrote deltamon <https://github.com/ldo/deltamon>, which lets you monitor the output of any command. For example, on my system, the command “ip -s link show dev eth0” produces output like this: 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master br0 state UP mode DEFAULT group default qlen 1000 link/ether 50:46:5d:05:5f:0b brd ff:ff:ff:ff:ff:ff RX: bytes packets errors dropped overrun mcast 55424147113 50269433 0 0 0 12618 TX: bytes packets errors dropped carrier collsns 33083163693 46933103 0 0 0 0 The number of bytes received is the first numberlike item on the fourth line, while the number of bytes transmitted is the first numberlike item on the sixth line. So I can monitor both of them with a command like deltamon "ip -s link show dev eth0" --autoscale=decimal \ "ip -s link show dev eth0" RX:4:1:B TX:6:1:B which will produce periodic output showing the running value of the counts and their rate of change, e.g. RX: 55_435_045_194B (2.616MB/s) TX: 33_098_780_129B (302.455kB/s)