VnStat – A network traffic monitor for Linux and BSD
humdi.net
humdi.net
I use it something like this with cron.
Bash - https://github.com/tuxy/bash/blob/master/vnstat.sh
HTML - https://github.com/tuxy/static/blob/master/vnstat.html
soconnect.d: http://dtracebook.com/index.php/Network_Lower_Level_Protocol...
soaccept.d: http://dtracebook.com/index.php/Network_Lower_Level_Protocol...
If you're on OSX and want to play around with dtrace, there are a bunch of really cool built-in scripts:
man -k dtrace