From owner-freebsd-hackers@FreeBSD.ORG Mon May 26 20:03:25 2008 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18632106564A for ; Mon, 26 May 2008 20:03:25 +0000 (UTC) (envelope-from mspitzer@gmail.com) Received: from wf-out-1314.google.com (wf-out-1314.google.com [209.85.200.172]) by mx1.freebsd.org (Postfix) with ESMTP id DD2198FC1E for ; Mon, 26 May 2008 20:03:24 +0000 (UTC) (envelope-from mspitzer@gmail.com) Received: by wf-out-1314.google.com with SMTP id 24so1740425wfg.7 for ; Mon, 26 May 2008 13:03:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=zicnhXz7h/Ew//xjjG2GGwrCsfHVf37ZO4BQ5DcB7Nc=; b=Nyvs9/aB9RXqgh/jrEGguokNW4n1KrAMlwuZ6MFI3IVrUKotUDlf42Hb4PS1k2p44hiO7UgdYLKMHg4sm5/5wMTyESi3d0zDRB/QgJ2F4S5duM0EnO24PR2RBgS5FkDGqdfbMoL3w+q/Fb15JxmSDyh0GVFVwJdkppbcmplqQUY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=AG8dXJyjXrEIbMQQoXf5qlccpmBwsBAVyNDMgmlXnEaTxZYTp48Ti04thMEIYtr6cCn6CrrhFR2KjeCFecXd4Ses1ER4VZapeflKoFX9ELbly7f04zhBqqKUhQ2+a5ddjfI7VgoxnNQpixPLjyz7/vs32zd2iTDVptBW+PoBHYI= Received: by 10.142.108.14 with SMTP id g14mr144557wfc.181.1211830648702; Mon, 26 May 2008 12:37:28 -0700 (PDT) Received: by 10.143.123.5 with HTTP; Mon, 26 May 2008 12:37:28 -0700 (PDT) Message-ID: <8c50a3c30805261237y6573a2c9ra4af56477d93af78@mail.gmail.com> Date: Mon, 26 May 2008 15:37:28 -0400 From: "Marc Spitzer" To: "Mathieu Prevot" In-Reply-To: <3e473cc60805260914r537f113eh8d840a94c0a5d958@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <3e473cc60805260752o2f573cf2h12910a45cf6849e6@mail.gmail.com> <20080526151614.GA5582@dan.emsphone.com> <3e473cc60805260914r537f113eh8d840a94c0a5d958@mail.gmail.com> Cc: hackers@freebsd.org, Dan Nelson Subject: Re: network bitrate of a poll of processes X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 May 2008 20:03:25 -0000 On Mon, May 26, 2008 at 12:14 PM, Mathieu Prevot wrote: > 2008/5/26 Dan Nelson : >> In the last episode (May 26), Mathieu Prevot said: >>> Hi, >>> >>> I would like to know the bitrate of a pool of child processes that use >>> a network connection, how can I have something like netstat -w1 >>> provide but at the process level ? >> >> If you can segregate them to their own UID, you can use an ipfw "count >> ip from any to any uid 6666" rule to count the packets. Another option >> would be to jail them to a dedicated IP address and count traffic on >> that IP. > > Both are nice... thank you. And don't you have something more portable > ie. that could run on "any" posix os - like a sh script that use > standard tools - and that doesn't need root user intervention ? > > Mathieu I do not think so, firewall for example is controlled by root. And users do not generally have detailed access to other users information. You can look into the BASM framework to track what your apps are doing and if you know the behavior to expect you can use netflow/argus/tcpdump to track that and post process the logs in each case into something useful. What are you trying to do, details do help? Thanks, marc -- Freedom is nothing but a chance to be better. Albert Camus