linux之网络流量监控

ifstat是一个比较简单的查看网络流量的工具

常用的参数如下:

       -l  Enables monitoring of loopback interfaces for which statistics are available. By default, ifstat monitors all non-loopback interfaces that are up.

       -a  Enables monitoring of all interfaces found for which statistics are available.

       -z  Hides interface which counters are null, eg interfaces that are up but not used.

       -i  Specifies the list of interfaces to monitor, separated by commas (if an interface name has a comma, it can be escaped with '\'). Multiple instances

           of the options are added together.

       -s  Equivalent to -d snmp:[comm@][#]host[/nn]] to poll a remote host through SNMP. See below for details.

       -h  Displays a short help message.

       -n  Turns off displaying the header periodically.

       -t  Adds a timestamp at the beginning of each line.

       -T  Reports total bandwith for all monitored interfaces.

       -A  Disables use of interface indexes: by default, when polling mechanism is index based (snmp, ifmib), ifstat remembers indexes of monitored inter-

           faces to poll only them. However, if interfaces indexes change often (new interfaces added, etc), you might loose some stats, hence this flag. Note

           that if you ask ifstat to monitor a non existent interface, it will poll all interfaces until it finds the requested one (regardless of this flag)

           so you can poll for an interface that goes up and down.

       -w  Uses fixed width columns, instead of enlarging them if needed for interfaces names to fit.

       -W  Wrap lines that are larger than the terminal width (implies -w). Wrapped lines are prefixed with a cycling letter to ease reading.

       -S  Keep stats updated on the same line if possible (no scrolling nor wrapping).

       -b  Reports bandwith in kbits/sec instead of kbytes/sec.

       -q  Quiet mode, warnings are not printed.

       -v  Displays version and the compiled-in drivers.

常用:

ifstat -TS

相关推荐