Linux users traffic measurement

I want to measure traffic(upload) made by each user on a linux system. Each users runs a rTorrent instance on a specified port. Also users could make traffic through the ftp server (vsftpd).

Is there a tool that can monitor traffic for a specified port and for ftp users ?


Solution 1:

Yes, you could do something like that with Ntop. It is a little cumbersome, and last time i used it, it reset all stats on restart, but you should be able to feed ntop data into Cacti for permanent safe-keeping.

This will require some hackery, but the result will be amazing. You could also feed the data straight into rrdtool. There are some really cool graph examples on rrdtool site.

UPDATE: Here is a graph that shows pretty much exact thing you are aiming for.

alt text

Solution 2:

Upload is outgoing traffic.

I suggest you to investigate the --uid-owner setting of iptables match module.