[plug] Network/Modem related questions

Timothy White weirdit at gmail.com
Sun Jul 3 19:15:28 WST 2005


Hi. I'm doing a little bit of programming atm and need to find out how
to get some realtime information about a ppp connection.
Mainly I need current transfer rates (up and down) and it'd be nice to
also have connection time and total transferred.
It all needs to be easy to use as it's all being used in scripts. 
I know that /proc/net/dev has total transmitted and received packets
and bytes so if I sampled it and new the time between sampling I can
get an average. Is that how other people do it? Would that be a little
CPU intensive?

As it's all for a web application the speed readings wouldn't be
needed all the time, just when the app requests it.

Also, whats the best way to tell that a modem is connecting but not
yet connected? I was think maybe see if pppd or chat is running but
ppp0 isn't up? Any other ideas?

Thanks

Tim



More information about the plug mailing list