Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

Thanks.

share|improve this question
    
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
add comment

3 Answers

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.

share|improve this answer
    
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
add comment

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.

share|improve this answer
add comment

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

share|improve this answer
    
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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