I am trying to write a small script to gather network statistics on my Linux system. Is there a way I can do this?
What I'm after is live statistics on the current network throughput. I have done some reading and found that
/proc/net/dev is useful, and I can parse in the content of this to work out current network speed. Is this a viable/reliable way of doing this? How do packages like iptraf and iftop calculate speed up and down?