Recording bw usage!
I need to record Tx/Rx bw in my c program at defined intervals. I am aware that there a bunch of available tools but I need a minimal version with only Tx/Rx bw with no other details. I have tried the tool bwm-ng which mostly serves my purpose but either it runs continuously in the console or saves result in html file. It does not have any options to save the result in txt file which could have been easy to parse.
Is there any other simple way to record Tx/Rx bw in a program?(without using tools from /proc/net/ or any)
I am using Mandriva Linux 18.104.22.168
if you have a (x)html you can xsl transform it into whatever you want as long the structure of the document is predictable.
ifconfig eth0 |grep bytes|cut -d":" -f2|cut -d" " -f1
ifconfig eth0 |grep bytes|cut -d":" -f3|cut -d" " -f1
this commands shoud give you information about rx and tx data on eth0, for example.
Also take a look on rrdtool.