measure traffic caused by pppd (UMTS)

Matthias Apitz guru at unixarea.de
Wed Mar 18 01:57:16 PDT 2009


El día Friday, May 16, 2008 a las 10:08:26PM +0200, Toni Schmidbauer escribió:

> At Fri, 2 May 2008 11:46:46 +0200,
> Matthias Apitz wrote:
> > Sometimes when I travel around and can't see any usable WLAN I'm using
> > the UMTS and PPPD, which works well but of course one must pay for this;
> 
> mb=`netstat -ib|awk '/tun0.*Link/ {mb=($6+$9)/1024^2; printf "%.2f",mb}'`
> date=`date "+%s`
             ^
I think there is a typo in your script;
and for me the fields of the netstat output are $7 and $10:

> echo "MB Transfered: $mb"
> echo "$date $mb" >> ~/tmp/grps_kosten.txt
> 
> works for me. i'm using the above code snipped after shutting down
> pppd.

will the 'netstat -ib' also count the LCP-echoreq/echo traffic in ppp0?

Thx

	matthias

-- 
Matthias Apitz
Manager Technical Support - OCLC GmbH
Gruenwalder Weg 28g - 82041 Oberhaching - Germany
t +49-89-61308 351 - f +49-89-61308 399 - m +49-170-4527211
e <matthias.apitz at oclc.org> - w http://www.oclc.org/ http://www.UnixArea.de/


More information about the freebsd-questions mailing list