How to determine total received bytes?


Id like a way to monitor the amount of traffic my machine recieves. IE: script runs ever 5 mins and tells me the amount received and event sent since time X. Im versed enough in shell adn perl to write it, but not sure where to get the data. It can be crude as long as it is accurate.

Any thoughts?



For a few weeks in 2004 I played with tcpdump (

From what I could tell you can use tcpdump to log everything that comes through a NIC. The data is just a list of packets, but if you know what you're doing you can analyze this.

It's certainly not as nice as Ethereal because it doesn't work the data for you, but it is very simple to use on the command line.