[Iftop-users] Outputting iftop to a file

Paul Warren pdw at ex-parrot.com
Mon, 24 Sep 2012 17:21:09 +0100


On 24/09/2012 17:08, Jonathan Abbey wrote:
> On Mon, 24 Sep 2012 10:51:08 -0500, Shannon Rodrigues wrote:
> | Hi Jon,
> |
> | Thank you for your reply.
> | In my typical setup, I want a tool which will display download rates of a
> | particular user/ subnet. I am configuring download limiting rules to user/
> | subnet but unfortunately have no tool to verify whether the config is
> | working or not.
>
> iftop doesn't know anything about what user is communicating, it just
> shows what ports and IP addresses are involved.
>
> | Manually checking output of iftop is helpful, but I would like to push the
> | output to a file so that I could verify this at the end of the day. Getting
> | it listed by ports is not a necessity. Traffic to and from will solve my
> | purpose.
> | I would like the output of download rate of a user/ subnet to be written to
> | a file for lets say a 5 second interval.
>
> Couldn't you use netstat (or ss, on more modern Linuxes) for that?  Or
> tcpdump with some after the fact filtering?
>
> iftop's claim to fame is real time curses-style graphing of traffic,
> there are plenty of tools for doing statistics gathering that would be
> more suitable for generating reports.

I did actually do a bit of work on having iftop dump stats to a file for 
a particular project that I had.

I don't intend to ever release it, and as Jon says, other tools are 
almost certainly a better starting point, but if you're particularly 
interested have a look at iftop-dump in CVS.

Paul