dongnan
总版主
总版主
  • 粉丝52
  • 发帖数2182
  • 铜币13514枚
  • 威望5930点
  • 银元150个
  • 社区居民
  • 最爱沙发
  • 忠实会员
  • 喜欢达人
  • 原创写手
阅读:851回复:0

sar 命令

楼主#
更多 发布于:2017-08-15 14:46
示例1: 网络设备IO
sar -n DEV 2 1
Linux 2.6.32-696.1.1.el6.x86_64 (ngw)     08/15/2017     _x86_64_    (4 CPU)

02:32:06 PM     IFACE   rxpck/s   txpck/s    rxkB/s    txkB/s   rxcmp/s   txcmp/s  rxmcst/s
02:32:08 PM        lo      0.00      0.00      0.00      0.00      0.00      0.00      0.00
02:32:08 PM      eth0   2189.53   1605.81   2238.95    246.55      0.00      0.00      0.00
02:32:08 PM      eth1   1639.53   2030.23    254.51   2023.72      0.00      0.00      0.00

Average:        IFACE   rxpck/s   txpck/s    rxkB/s    txkB/s   rxcmp/s   txcmp/s  rxmcst/s
Average:           lo      0.00      0.00      0.00      0.00      0.00      0.00      0.00
Average:         eth0   2189.53   1605.81   2238.95    246.55      0.00      0.00      0.00
Average:         eth1   1639.53   2030.23    254.51   2023.72      0.00      0.00      0.00

采集网络设备io,间隔时间 2秒,共计采集 1次。

帮助
man sar
NAME
       sar - Collect, report, or save system activity information.

SYNOPSIS
       sar  [ -A ] [ -b ] [ -B ] [ -C ] [ -d ] [ -h ] [ -i interval ] [ -m ] [ -p ] [ -q ] [ -r ] [ -R ] [ -S ] [ -t ] [ -u [ ALL ] ] [
       -v ] [ -V ] [ -w ] [ -W ] [ -y ] [ -j { ID | LABEL | PATH | UUID | ... } ] [ -n { keyword [,...] | ALL } ] [ -I { int  [,...]  |
       SUM  |  ALL | XALL } ] [ -P { cpu [,...] | ALL } ] [ -o [ filename ] | -f [ filename ] ] [ --legacy ] [ -s [ hh:mm:ss ] ] [ -e [
       hh:mm:ss ] ] [ interval [ count ] ]

DESCRIPTION
       The sar command writes to standard output the contents of selected cumulative activity counters in  the  operating  system.  The accounting  system,  based  on the values in the count and interval parameters, writes information the specified number of times spaced at the specified intervals in seconds.  If the interval parameter is set to zero, the sar command  displays  the  average statistics  for  the time since the system was started. If the interval parameter is specified without the count parameter, then reports are generated continuously.  The collected data can also be saved in the file specified by  the  -o  filename  flag,  in  addition  to being displayed onto the screen. If filename is omitted, sar uses the standard system activity daily data file, the  /var/log/sa/sadd file, where the dd parameter indicates the current day.  By default all the data available from the kernel  are  saved in the data file.

       -n { keyword [,...] | ALL }
              Report network statistics.

              Possible keywords are DEV, EDEV, NFS, NFSD, SOCK, IP, EIP, ICMP, EICMP, TCP, ETCP, UDP, SOCK6, IP6, EIP6,  ICMP6,  EICMP6
              and UDP6.

              With the DEV keyword, statistics from the network devices are reported.  The following values are displayed:

更多,参考这里
#
游客

返回顶部