http://www.stickit.nu/nettopI loved nettop, however I was disappointed with it's inability to redirect to a file. I wanted to redirect the contents to a file without appending to that file (it would be huge!) so I could look at that file for any given time and see the current snapshot of bandwidth and protocol usage. After searching for many alternatives with no luck I decided to modify the source code directly. By doing so you can now look at a single file and see basically what you would in a 'GUI'.
[root@inet01 /webapps]# nettop -?
Usage: nettop [-s|-p] [-l] [-t [-h]] [-i dev] [-d delay] [-n num] [-?]
-s Sort by size
-p Sort by number of packets
-l Supress tree lines
-t Output plain text
-h Show table header
-i device Select interface [eth0, eth1, etc]
-o file (assumes -t -h -l) Output display to [file]
-d delay Delay in seconds between updates
-n number Number of updates to run before stopping
-? This screen
The command you would want to run would be:
nettop -s -o /tmp/nettop.log -i eth1 -d 15 > /dev/null &
This would background the program and you can at anytime "cat /tmp/nettop.log" and get your current snapshot.
Hope this helped,
Nathan