Python linux net activity statistics

What is the easiest way to get network statistics (bandwidth used, current down / up speed) through Python.

I understand that this should be the / proc system call, but is there an easier way or some tool that is available with standard * nix distributions for this?

thank

NOTE. I am going to use / proc / net / dev and parse the output 8 -)

+3
source share
1 answer

You can try using http://pypi.python.org/pypi/pynetinfo/ - you need an extension to get statistics, but this should be pretty trivial. Most of the code is already installed.

Alternatively, you can simply analyze the output ip -s link show device_name

+4
source

All Articles