Some user launches a set of programs. I need to get statistic about traffic for the programs executed by these user. But not summary for this user, but for each program executed by it separately.

Tell me please, how I can implement the task?

OS: ubuntu-server, centos


  • Are these programs requesting same services/IP/ports, etc? Are these programs executed on the same machine for all users? Do you want to do the calculations on the same machine or a different one like gateway? – Khaled Sep 3 '12 at 11:51
  • It is allowed to user to create only TCP/UPD sockets, and will be connected anywhere. Yes, programs are executed by one machine, and only one user. Yes, by the same machine. – niXman Sep 3 '12 at 11:57
  • What OS will these users be using? – Bart B Sep 3 '12 at 13:45
  • ubuntu-server, centos. – niXman Sep 3 '12 at 19:58

You don't say what OS the computer in question is running, but if it's OS X then Rubbernet will do what you need, and it's available in the Mac app store.

  • In tags 'linux' is specified. I supposed, from this it is possible to understand about what OS is told... – niXman Sep 3 '12 at 20:00
  • Sorry - I just read the question. Surely it wouldn't hurt to be explicit? – Bart B Sep 4 '12 at 11:30

Linux makes it really hard getting per-process network usage, but it can be done by capturing each packet individually and summing up the packet lengths assuming you have super user privileges. nethogs does this.


I use iftop(8) for this.
It should be in the Dries/Dags/RPM Forge repositories for CentOS.

  • Unfortunately iftop can't do this for each process separately. – scai Sep 4 '12 at 6:26
  • I re-read the question and I see how iftop wouldn't work for this. Sorry for the noise. :( – Gazzonyx Sep 4 '12 at 6:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.