
On Fri, 4 Jan 2019 14:11:51 +1300, Peter Reutemann quoted:
'Linux systems provide a handy suite of commands for helping you see how busy your disks are, not just how full.'
dstat is also useful for monitoring overall network activity. But sometimes I want to know how much traffic is going through a specific network interface (e.g. my Internet connection, so I can track my data usage). If I do “ifconfig ppp0” on my router machine, I get something like: ppp0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1500 inet 118.92.62.178 netmask 255.255.255.255 destination 118.92.63.254 ppp txqueuelen 3 (Point-to-Point Protocol) RX packets 93769263 bytes 73566327122 (68.5 GiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 76602145 bytes 22711761427 (21.1 GiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 I want to watch those “bytes” numbers on the “RX” and “TX” lines, to see how rapidly they are growing. This is why I wrote deltamon <https://github.com/ldo/deltamon>. This lets you monitor the output of any command. In the above, I want to watch the output from periodic invocations of “ifconfig ppp0”, and report the rates at which the second numbers on each of the fourth and sixth lines are increasing. I can do this with a command like deltamon "ifconfig ppp0" RX:4:2:B TX:4:2:B The general form being deltamon «command» «monitor-spec» ... where each «monitor-spec» specifies an explanatory prefix for the report line, a line number from the command output, and which numeric item on that line to get the data from, optionally followed by a unit suffix (here I am using “B” to represent "bytes”). deltamon invokes the specified command at given intervals (defaulting to 2 seconds), and extracts and outputs the specified numbers each time, along with their rate of change per second since the last command invocation. Of course, deltamon can be used to monitor the output of any command. For example, du or df to check disk usage while some large file is being transferred.