Posts Tagged ‘nicstat’

nicstat 网络流量统计利器

February 27th, 2013 6 comments

原创文章,转载请注明: 转载自系统技术非业余研究

本文链接地址: nicstat 网络流量统计利器

前段时间看到brendangregg的 Linux Performance Analysis and Tools PPT里面提到的nicstat,研究了下是个不错的东西,分享给大家。

nicstat is to network interfaces as “iostat” is to disks, or “prstat” is to processes.

nicstat原本是Solaris平台下显示网卡流量的工具,Tim Cook将它移植到linux平台,官方网站见 这里。 相比netstat, 他有以下关键特性:

  • Reports bytes in & out as well as packets.
  • Normalizes these values to per-second rates.
  • Reports on all interfaces (while iterating)
  • Reports Utilization (rough calculation as of now)
  • Reports Saturation (also rough)
  • Prefixes statistics with the current time

我们来体验下,首先安装之,源码在 这里 下, 目前最新的版本是1.92。

$ uname -r
$ diff Makefile.Linux64 Makefile.Linux
< CFLAGS =      $(COPT) -m32
> CFLAGS =      $(COPT)

$ sudo make -f Makefile.Linux install  
sudo install -o root -g root -m 4511 `./ --bin-name` /usr/local/bin/nicstat
sudo install -o bin -g bin -m 555 enicstat /usr/local/bin
sudo install -o bin -g bin -m 444 nicstat.1 /usr/local/share/man/man1/nicstat.1


使用文档在这里: man nicstat
Read more…

Post Footer automatically generated by wp-posturl plugin for wordpress.