Saturday, December 30, 2017
HowTo Monitor network traffic with vnStat on FreeBSD
HowTo Monitor network traffic with vnStat on FreeBSD
vnStat is a console-based network traffic monitor. It keeps a log of
hourly, daily and monthly network traffic for the selected interface(s).
Bellow youll find the needed steps for its installation and setup on FreeBSD 7.0:
- % su
- # cd /usr/ports/net/vnstat ; make install clean
- # rehash
- # ifconfig -a
- # vnstat -u -i rl0
- # cat /usr/local/share/doc/vnstat/vnstat-cron >> /etc/crontab
Step 4 purpose is to find out the system network interface(s) in use, which in my case is rl0.
Finally with step 6 weve activated the cron job to feed vnStats database following the ports supplied example.
To display the default statistics:
- % vnstat
- % vnstat -d
- % vnstat -m
- % vnstat -l -i rl0
- % vnstat --help
Further documentation is available at http://humdi.net/vnstat/.