FreeBSDに係わる構築や維持など

Archive for 12月, 2008

vnStat is a console-based network traffic monitor

bsd# cd /usr/ports/net/vnstat/
bsd# make install clean distclean

###########################################################################
vnstat has been installed.

This port neeeds a cron entry. Please copy the contents of:
/usr/local/share/doc/vnstat/vnstat-cron to your crontab. A Sample
configuration file has be installed in /usr/local/etc/

For more information about vnStat use "man vnstat" or visit:

http://humdi.net/vnstat/

###########################################################################

===>   Registering installation for vnstat-1.6_3
===>  Cleaning for vnstat-1.6_3
===>  Deleting distfiles for vnstat-1.6_3
bsd# rehash
bsd# vnstat
No database found, nothing to do. Use --help for help.

A new database can be created with the following command:
    vnstat -u -i fxp0

Replace 'fxp0' with the interface that should be monitored. A list
of available interfaces can be seen with the 'ifconfig' command.

bsd# vnstat -u -i em0
Error:
Unable to read database "/var/db/vnstat/em0".
-> A new database has been created.

bsd# vnstat -l -i em0
Monitoring em0...    (press CTRL-C to stop)

   rx:       0.03 kB/s     0 p/s            tx:       0.19 kB/s     0 p/s^C

 em0  /  traffic statistics

                             rx       |       tx
--------------------------------------+----------------------------------------
  bytes                       163 kB  |         22 kB
--------------------------------------+----------------------------------------
          max             53.53 kB/s  |     6.49 kB/s
      average             12.56 kB/s  |     1.71 kB/s
          min              0.03 kB/s  |     0.19 kB/s
--------------------------------------+----------------------------------------
  packets                        211  |           170
--------------------------------------+----------------------------------------
          max                 62 p/s  |        47 p/s
      average                 16 p/s  |        13 p/s
          min                  0 p/s  |         0 p/s
--------------------------------------+----------------------------------------
  time                    13 seconds