From owner-freebsd-questions@FreeBSD.ORG Wed Mar 18 08:57:15 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 735DD10656DC for ; Wed, 18 Mar 2009 08:57:15 +0000 (UTC) (envelope-from Matthias.Apitz@oclc.org) Received: from mail.pica.nl (mail.pica.nl [192.87.44.30]) by mx1.freebsd.org (Postfix) with ESMTP id 112258FC0A for ; Wed, 18 Mar 2009 08:57:14 +0000 (UTC) (envelope-from Matthias.Apitz@oclc.org) Received: from rebelion.Sisis.de ([10.0.1.29]) by mail.pica.nl with Microsoft SMTPSVC(6.0.3790.3959); Wed, 18 Mar 2009 09:57:13 +0100 Received: (from guru@localhost) by rebelion.Sisis.de (8.14.2/8.13.8/Submit) id n2I8vBk6003370; Wed, 18 Mar 2009 09:57:11 +0100 (CET) (envelope-from matthias.apitz@oclc.org) X-Authentication-Warning: rebelion.Sisis.de: guru set sender to matthias.apitz@oclc.org using -f Date: Wed, 18 Mar 2009 09:57:11 +0100 From: Matthias Apitz To: Toni Schmidbauer Message-ID: <20090318085711.GA3105@rebelion.Sisis.de> References: <20080502094646.GA3576@rebelion.Sisis.de> <87wslu811h.wl%pinhead@bluebook.stderror.at> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87wslu811h.wl%pinhead@bluebook.stderror.at> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.0-STABLE (i386) X-OriginalArrivalTime: 18 Mar 2009 08:57:13.0227 (UTC) FILETIME=[878C5DB0:01C9A7A7] Cc: freebsd-questions@freebsd.org Subject: Re: measure traffic caused by pppd (UMTS) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Matthias Apitz List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Mar 2009 08:57:16 -0000 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 - w http://www.oclc.org/ http://www.UnixArea.de/