From owner-freebsd-questions@FreeBSD.ORG Mon Apr 28 19:28:11 2008 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 A2AD6106567E for ; Mon, 28 Apr 2008 19:28:11 +0000 (UTC) (envelope-from beni@brinckman.info) Received: from lmailproxy03.edpnet.net (lmailproxy03.edpnet.net [212.71.1.196]) by mx1.freebsd.org (Postfix) with ESMTP id 38E7D8FC15 for ; Mon, 28 Apr 2008 19:28:11 +0000 (UTC) (envelope-from beni@brinckman.info) Received: from [192.168.1.101] (212.71.14.16.adsl.dyn.edpnet.net [212.71.14.16]) by lmailproxy03.edpnet.net (8.13.1/8.13.1) with ESMTP id m3SI0llD030035; Mon, 28 Apr 2008 20:00:47 +0200 From: beni To: freebsd-questions@freebsd.org Date: Mon, 28 Apr 2008 18:00:46 +0000 User-Agent: KMail/1.9.7 References: <20080424181040.GB14991@nupfel.de> In-Reply-To: <20080424181040.GB14991@nupfel.de> X-Face: $,~&QrDrInYiH(ZUXjNH_0r4q\`w83!}&; +8c.K[`NnZwV|m$5N{NCkWesaR.9|yqIC[<=?utf-8?q?d=0A=09P0?="xTw:F|)_r*WC\f8lz)g=a; 93dz2mP7iv)LLzBd; 6^Y:=*>@U; _\+4( MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200804281800.46883.beni@brinckman.info> X-Virus-Scanned: ClamAV version 0.91.2, clamav-milter version 0.91.2 on lmailproxy03.edpnet.net X-Virus-Status: Clean X-Spam-Status: No, score=-0.8 required=5.0 tests=ALL_TRUSTED,BAYES_60 autolearn=disabled version=3.1.9 X-Spam-Checker-Version: SpamAssassin 3.1.9 (2007-02-13) on lmailproxy03.edpnet.net Cc: Tobias Kirschstein Subject: Re: simple network traffic query tool X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: beni@brinckman.info List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Apr 2008 19:28:11 -0000 On Thursday 24 April 2008 18:10:40 Tobias Kirschstein wrote: > hi, > > i'm looking for a small tool to query the current network traffic (kb > IN and OUT) per interface. is there any sysctl or tool which gives me a > similar output to "systat -ifstat": > > /0 /1 /2 /3 /4 /5 /6 /7 /8 /9 /10 > Load Average |||| > > Interface Traffic Peak Total > lo0 in 0.000 KB/s 0.000 KB/s 226.079 KB > out 0.000 KB/s 0.000 KB/s 226.079 KB > > wpi0 in 0.000 KB/s 0.000 KB/s 164.577 MB > out 0.000 KB/s 0.000 KB/s 6.205 MB > > the background: > unfortunately the network monitor build into superkaramba does not work > for freebsd, os i want to write a widget which uses sysctl or any other > tool if available got get this information. systat is not appropriate > to be used because it does not terminate on its own as i see. I'm using a modified version of Superkarambas CompactMonitor. It is written for Linux I think, but easily adaptable for freebsd. All I did was moddify the ~/.kde/share/apps/superkaramba/themes/CompactMonitor/CompactMonitor.theme file : text x=435 y=50 sensor=network device="vr0" format="%in KB/s" decimals=1 text x=370 y=50 value="Download" text x=570 y=50 sensor=program program="netstat -ibh | grep Link#1 | awk '{print $7}'" align=right interval=1000 text x=435 y=65 sensor=network device="vr0" format="%out KB/s" decimals=1 text x=370 y=65 value="Upload" text x=570 y=65 sensor=program program="netstat -ibh | grep Link#1 | awk '{print $10}'" align=right interval=1000 Add graph x=370 y=30 sensor=network device="vr0" format="%out" w=200 h=15 color=255,127,127 interval=1000 max=100 graph x=370 y=30 sensor=network device="vr0" format="%in" w=200 h=15 color=127,230,180 interval=1000 max=100 if you want to add a graphic representation and change the "vr0" according to your (ethernet) device. It works for me with kde 3.5.8 on 7.0-stable. -- Beni.