
VnStat – A network traffic monitor for Linux and BSD - merah
http://humdi.net/vnstat/
======
tux
You can also use vnstat with vnstati to generate nice graphs.

I use it something like this with cron.

Bash -
[https://github.com/tuxy/bash/blob/master/vnstat.sh](https://github.com/tuxy/bash/blob/master/vnstat.sh)

HTML -
[https://github.com/tuxy/static/blob/master/vnstat.html](https://github.com/tuxy/static/blob/master/vnstat.html)

------
mrpippy
I've used vnstat for traffic monitoring on Linux/BSD routers for years, simple
and does the job. The on-disk format is _not_ machine-independent though, I
had to start my records over when OpenBSD went to 64-bit time_t.

~~~
yc1010
I have been using it for years as well but instead of having it running all
the time I just run "vnstat -i eth0 -tr" every minute with cron and log that 5
second average result

~~~
feld
Is there a reason why? I find vnstat to use zero noticeable resources even
under high traffic load (1Gb)

~~~
johnpowell
Same.. It is one of the first things I install on a new server. I have never
noticed it using gobs of RAM or CPU.

------
Cieplak
Been looking for a tool like iptraf or nethogs for OSX. nettop is ok. My
favorite thus far are these two dtrace scripts for tracing network
connections:

soconnect.d:
[http://dtracebook.com/index.php/Network_Lower_Level_Protocol...](http://dtracebook.com/index.php/Network_Lower_Level_Protocols:soconnect.d#Mac_OS_X)

soaccept.d:
[http://dtracebook.com/index.php/Network_Lower_Level_Protocol...](http://dtracebook.com/index.php/Network_Lower_Level_Protocols:soaccept.d#Mac_OS_X)

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

~~~
steckerbrett
`iftop` works well on OSX.

