What is the easiest way to get network statistics (bandwidth used, current down/up rate) via Python.
I realize it'll have to be a system call to /proc, but is there an easier way or some tool that is available on standard *nix distributions for doing so?
Thanks
NOTE: I am going to use /proc/net/dev and parse the output 8-)
You could try using http://pypi.python.org/pypi/pynetinfo/ - it would need extending to get the statistics, but that should be fairly trivial. Most of the code is already in place.
Alternatively you can just parse the output of ip -s link show device_name
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With