Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have a python script that uses urllibs to parse some web pages, and uses selenium to scrape pages with javascript, and I would like to know its cumulative bandwidth usage. I've looked at nethogs, but its tells me the usage per second, but won't tell me how much data the script has received or sent on eth0, for example.

Ideally, I would want it to track all new processes after I start monitoring, and then keep a table of what each process has used as a total.

Does such a tool exist? If not, is there a library in Python that I can implement in the script to track this?

share|improve this question
    
what did you change? –  user779420 Jun 9 '11 at 10:30
    
Trickle is a tool to limit the bandwidth of a process or a bunch of processes. It has everything in hand to compute what you want, but doesn't seem to have a way to print it out. –  Gilles Jun 9 '11 at 22:58

1 Answer 1

If you are looking for a network monitor that runs as an external process and can provide per-connection statistics on the number of transferred bytes, then IPTraf can do that.

Take a look at the example screenshots, especially the TCP/UDP statistical breakdown.

share|improve this answer
    
Someone might be interested in fork of IPTraf , which is IPTraf-ng. –  Grzegorz Wierzowiecki Dec 11 '11 at 8:57

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.