Monitoring network bandwidth usage
During the development of my monitoring tool, I've faced a little challenge - find a crossplatform (Linux/FreeBSD) way to monitor network bandwidth usage. Surprisingly, there is no simple way to do it. In this post I'll reveal my research and the solution I've found and implemented. Linux One of the ways to do it is using ifconfig output: $ ifconfig eth0 eth0 Link encap:Ethernet HWaddr 00:23:54:15:54:96 inet addr:192.168.1.4 Bcast:192.168.1.255 Mask:255.255.255.0 inet6 addr: fe80::223:54ff:fe15:5496/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:23242 errors:0 dropped:0 overruns:0 frame:0 TX packets:22369 errors:0 dro...