Ethereal-users: Re: [Ethereal-users] Port usage question.

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Gerald Combs <gerald@xxxxxxxxxxxx>
Date: Fri, 6 Dec 2002 09:08:18 -0600 (CST)
On Fri, 6 Dec 2002, Matt Hanley wrote:

> I looking to gather information about which ports are being used on a
> particular system (not which ports are open, but which ones are in use, and
> how much).  Is it possible to configure Ethereal to gather that info?  I'm
> not looking to save the actual information contained in the packets.
> 
> I have a notion that there are packages out there better suited for the
> task, so if any has any ideas let me know - keeping in mind that this is for
> a Solaris 2.6 box (which limits things quite a bit).

It should be possible to write a script that can parse the output of
tethereal (or snoop or tcpdump for that matter) and give you per-port
utilization statistics.  However, it would be a lot easier to just install
lsof and run 'lsof -i'.  "In-use" ports are shown with a nonzero byte
offset.  Lsof packages for 2.6 are available at www.sunfreeware.com.