I am trying to calculate total network traffic on wlan1 interface through a python code. Uptil now I tried ethtool,iftop,ifstat,nethogs but most of these tools show ncurses interface(text base UI).
I tried something like this
import subprocess
nw_usage = subprocess.Popen(['ifstat', '-i', 'wlan1'])
but it doesn't give me network usage values.
I could not figure out how to get network usage values in a single variable from ncurses interfaces. ( and I am getting a feeling that there would be some better way to calculate network usage)
Any help or direction will be a great favor.
Thanks
tshark, the commandline version of wireshark?x=somefunction(wlan1)should give mex Kbps/Mbpswhich I can compare with max transmission rate of that interface (i.e. 56Mbps connection speed)inspectorG4dgetI just tried tshark,but I don't need packets... I need transmission rate