FreeBSD6.0Release下查看带宽使用情况的几个命令

作为一台服务器,流量的监控是对服务器及网络状况了解的基本方法。下面介绍几个常见的流量控制命令,测试操作系统为FreeBSD6.0-STABLE。

系统:FreeBSD6.0-STABLE
命令:systat -if 1
作用:查看当前网卡使用带宽
说明:地址
截图:


系统:FreeBSD6.0-STABLE
命令:systat -ip 1
作用:查看包的进出流量
说明:地址
截图:


系统:FreeBSD6.0-STABLE
命令:netstat -w 1
命令2:netstat -I xl0 -w 1  ( 针对某一网卡 )
显示:

proxy4# netstat -w 1
            input        (Total)           output
   packets  errs      bytes    packets  errs      bytes colls
       490     0     293465        471     0     291479    20
       637     0     422915        615     0     424242    19
       516     0     292878        484     0     287469     1
       636     0     359417        623     0     366162    24
       643     0     398575        620     0     396108     6
       397     0     223827        357     0     216218     1
       652     0     387266        594     0     387248     6
      1192     0     880611       1211     0     880889    11
      1118     0     766515       1158     0     786116    41
       683     0     222295        667     0     469522    78
       367     0     168580        317     0     168386    11


最后再介绍一种方法,安装软件ifstat (软件缺点为不能对packet进行查看),简单步骤:

1、从ifstat站点下载安装程序ifstat-1.1.tar.gz

2、通过ftp拷贝到服务器目录/home/funpower

3、开始解压安装

# cd /home/funpower
# tar zxvf ifstat-1.1.tar.gz
# cd ifstat-1.1
# ./configure
# make
# make install

安装后运行文件在/usr/local/bin中,运行命令/usr/local/bin/ifstat -T即可,显示:

proxy4# /usr/local/bin/ifstat -T
       em0                 xl0                Total      
 KB/s in  KB/s out   KB/s in  KB/s out   KB/s in  KB/s out
  131.43    140.67    138.74    122.00    270.17    262.67
  263.71     52.08     76.88    292.99    340.59    345.06
  105.56     66.81     77.14    107.89    182.70    174.70
  197.34     52.30     56.45    197.04    253.79    249.34
  134.58     86.54     91.04    127.76    225.63    214.30
  258.52    115.93    122.95    264.30    381.47    380.23
  263.18     97.04     99.35    262.61    362.53    359.65
  188.37     81.11     85.97    186.95    274.33    268.06
 1454.64    254.00    195.22    958.37   1649.86   1212.37
  817.75     98.48     89.88   1215.27    907.63   1313.75
  103.63     86.91     91.40    100.19    195.04    187.11
  169.13     90.91     93.90    169.82    263.03    260.73
   98.50     62.44     71.99    100.08    170.49    162.52
  229.68     40.02     46.04    234.33    275.72    274.35
  127.43     56.29     61.46    126.99    188.89    183.28
  215.35     54.20     58.64    206.41    273.99    260.61
  150.32     91.31     97.86    161.00    248.18    252.31
  348.61     95.47    105.77    393.79    454.38    489.26
  256.18    118.05    128.72    274.98    384.90    393.03

2 Comments

  1. hlddn说道:

    http://new.pdx.cn/blog/diary,458122.html

    用这个也不错哦。

    ps:http://hlddn.pdx.cn/blog/diary,408265.html

    我收到的solaris光盘只有一张。汗……

Leave a Reply