Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 May 2016 11:07:46 +0200
From:      Ben Woods <woodsb02@gmail.com>
To:        Yuri <yuri@rawbw.com>
Cc:        "freebsd-net@freebsd.org" <freebsd-net@freebsd.org>
Subject:   Is there a way to keep an account of which processes generate how much network traffic?
Message-ID:  <CAOc73CDN3-qq9OPq-hT1Pn5tD-D6UrGAbDaScQ%2BXsKzW_grzbw@mail.gmail.com>
In-Reply-To: <b4fd52e8-5b9b-aa85-e1ac-1c7a461f381d@rawbw.com>
References:  <b4fd52e8-5b9b-aa85-e1ac-1c7a461f381d@rawbw.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Monday, 30 May 2016, Yuri <yuri@rawbw.com
<javascript:_e(%7B%7D,'cvml','yuri@rawbw.com');>> wrote:

> There is vnstat that does this by interface.
>
> But is there a way to do this by the application? This is because nearly
> every packet that is sent through the system is sent on behalf of some
> process running on the system.
>
> It would be nice to be able to see which applications (in general sense)
> generate most traffic.
>
> I am fully aware that the link between pid and an "application" is vague
> because some processes are run through some cryptic command lines. I am
> just interested if anything exists in this area at all.
>
>
> Yuri
>

Hi Yuri,

There is an application called nethogs which does this on Linux, but the
website says it makes heavy use of Linuxisms so won't work on BSD. I had a
quick look at the code and couldn't immediately recognise the Linuxisms in
question, but haven't done a thorough look.

On FreeBSD, I tend to filter traffic by src and destination ip/port to
determine how much traffic an application is using.

Easiest solution I can think of: Use net-mgmt/darkstat.
https://unix4lyfe.org/darkstat/

Slightly more complicated solution, but with potentially more power for
filtering the data: Netflow/NfDump/NfSen
https://forums.freebsd.org/threads/49724/

Good luck!

Regards,
Ben


-- 

--
From: Benjamin Woods
woodsb02@gmail.com



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAOc73CDN3-qq9OPq-hT1Pn5tD-D6UrGAbDaScQ%2BXsKzW_grzbw>