vmstat命令详解

一、vmstat命令的作用:

Virtual Meomory Statistics(虚拟内存统计)的缩写,用来获得有关进程、内存、虚拟内存、页面交换空间及 CPU活动的信息。这些信息反映了系统的负载情况

二、使用方式

1、vmstat interval count

其中,interval表示的是刷新时间间隔,count 表示的是总共刷新的次数。

举例:

[root@localhost proc]# vmstat 1 3
#使用vmstat检测,每隔1秒刷新一次,共刷新3次
procs ——memory—— swap —io system ——cpu——
r b swpd free buff cache si so bi bo in cs us sy id wa st
r b swpd free buff cache si so bi bo in cs us sy id wa st
0 0 0 407376 55772 84644 0 0 5 2 9 10 0 0 100 0 0
0 0 0 407368 55772 84644 0 0 0 0 12 10 0 0 100 0 0
0 0 0 407368 55772 84644 0 0 0 0 15 13 0 0 100 0 0

该命令的输出种字段代表的含义:
procs 含义:进程信息

r:等待运行的进程数量,数值越大代表系统越繁忙

b:不可被唤醒的进程数量,数值越大代表系统越繁忙

memory含义:内存信息

swpd:虚拟内存使用情况,单位KB

free:空闲内存空间,单位KB

buff:缓冲的内存空间 ,单位KB

cache:缓存的内存空间,单位KB

swap  含义:交换分区信息

si:从磁盘中交换至内存的数据量,单位KB

so:从内存中交换到磁盘中的数据量,单位KB

这2各字段数值越大,代表内存和磁盘之间的转换越频繁,系统的性能越差

io 含义:磁盘读/写信息

bi: 从块设备中读入的数据的总量,单位是块。

bo:写到块设备的数据的总量,单位是块。

这两个数越大,代表系统的 I/O 越繁忙。

system 含义:系统信息字段

in:每秒钟被中断的进程次数

cs:每秒钟进行的时间切换次数

这两个数值越大,代表系统和接口设备的通讯越频繁

cpu CPU信息字段:

us:非内核进程消耗 CPU 运算时间的百分比

sy:内核进程消耗 CPU 运算时间的百分比

id:空闲 CPU 的百分比

wa:等待 I/O 所消耗的 CPU 百分比

st:被虚拟机所盗用的 CPU 百分比

ostat主要用于监控系统设备的IO负载情况,根据这个可以看出当前系统的写入量和读取量,CPU负载和磁盘负载。

一、概述

iostat 主要用于输出磁盘IO 和 CPU的统计信息。

iostat属于sysstat软件包。可以用yum install sysstat 直接安装

[root@localhost shitou]# yum install sysstat
Loaded plugins: fastestmirror, product-id, search-disabled-repos, subscription-
              : manager
 
This system is not registered with an entitlement server. You can use subscription-manager to register.
 
Loading mirror speeds from cached hostfile
base                                                     | 3.6 kB     00:00
docker-ce-stable                                         | 3.5 kB     00:00
extras                                                   | 2.9 kB     00:00
updates                                                  | 2.9 kB     00:00
Resolving Dependencies
--> Running transaction check
---> Package sysstat.x86_64 0:10.1.5-19.el7 will be installed
--> Processing Dependency: libsensors.so.4()(64bit) for package: sysstat-10.1.5-19.el7.x86_64
--> Running transaction check
---> Package lm_sensors-libs.x86_64 0:3.4.0-8.20160601gitf9185e5.el7 will be installed
--> Finished Dependency Resolution
 
Dependencies Resolved
 
================================================================================
 Package            Arch      Version                             Repository
                                                                           Size
================================================================================
Installing:
 sysstat            x86_64    10.1.5-19.el7                       base    315 k
Installing for dependencies:
 lm_sensors-libs    x86_64    3.4.0-8.20160601gitf9185e5.el7      base     42 k
 
Transaction Summary
================================================================================
Install  1 Package (+1 Dependent package)
 
Total download size: 357 k
Installed size: 1.2 M
Is this ok [y/d/N]: y
Downloading packages:
(1/2): lm_sensors-libs-3.4.0-8.20160601gitf9185e5.el7.x86_ |  42 kB   00:01
(2/2): sysstat-10.1.5-19.el7.x86_64.rpm                    | 315 kB   00:01
--------------------------------------------------------------------------------
Total                                              188 kB/s | 357 kB  00:01
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : lm_sensors-libs-3.4.0-8.20160601gitf9185e5.el7.x86_64        1/2
  Installing : sysstat-10.1.5-19.el7.x86_64                                 2/2
  Verifying  : sysstat-10.1.5-19.el7.x86_64                                 1/2
  Verifying  : lm_sensors-libs-3.4.0-8.20160601gitf9185e5.el7.x86_64        2/2
 
Installed:
  sysstat.x86_64 0:10.1.5-19.el7
 
Dependency Installed:
  lm_sensors-libs.x86_64 0:3.4.0-8.20160601gitf9185e5.el7
 
Complete!
[root@localhost shitou]# iostat -help
Usage: iostat [ options ] [ <interval> [ <count> ] ]
Options are:
[ -c ] [ -d ] [ -h ] [ -k | -m ] [ -N ] [ -t ] [ -V ] [ -x ] [ -y ] [ -z ]
[ -j { ID | LABEL | PATH | UUID | ... } ]
[ [ -T ] -g <group_name> ] [ -p [ <device> [,...] | ALL ] ]
[ <device> [...] | ALL ]
 
-c: 显示CPU使用情况
-d: 显示磁盘使用情况
-N: 显示磁盘阵列(LVM) 信息
-n: 显示NFS 使用情况
-k: 以 KB 为单位显示
-m: 以 M 为单位显示
-t: 报告每秒向终端读取和写入的字符数和CPU的信息
-V: 显示版本信息
-x: 显示详细信息
-p: [磁盘] 显示磁盘和分区的情况
[root@localhost shitou]# iostat
Linux 3.10.0-1160.71.1.el7.x86_64 (localhost.localdomain)       08/31/22       _x86_64_ (1 CPU)
 
avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           2.01    0.00    2.82    2.67    0.80   91.70
 
Device:            tps    kB_read/s    kB_wrtn/s    kB_read    kB_wrtn
scd0              0.02         1.39         0.00       1028          0
sda              13.18       606.16        61.70     449791      45781
dm-0             12.62       589.09        51.61     437119      38295
dm-1              2.46         3.71         8.64       2756 
 
cpu属性值说明:
 
%user:CPU处在用户模式下的时间百分比。
%nice:CPU处在带NICE值的用户模式下的时间百分比。
%system:CPU处在系统模式下的时间百分比。
%iowait:CPU等待输入输出完成时间的百分比。
%steal:管理程序维护另一个虚拟处理器时,虚拟CPU的无意识等待时间百分比。
%idle:CPU空闲时间百分比。
 
备注:
 
如果%iowait的值过高,表示硬盘存在I/O瓶颈,%idle值高,表示CPU较空闲,如果%idle值高但系统响应慢时,有可能是CPU等待分配内存,此时应加大内存容量。%idle值如果持续低于10,那么系统的CPU处理能力相对较低,表明系统中最需要解决的资源是CPU。
disk属性值说明:
 
磁盘名称
device:磁盘名称
tps:每秒钟发送到的I/O请求数.
Blk_read/s:每秒读取的block数.
Blk_wrtn/s:每秒写入的block数.
Blk_read:读入的block总数.
Blk_wrtn:写入的block总数.
[root@localhost shitou]# iostat -c
Linux 3.10.0-1160.71.1.el7.x86_64 (localhost.localdomain)       08/31/22       _x86_64_ (1 CPU)
 
avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           3.22    0.00    4.53    4.32    1.30   86.64
 
[root@localhost shitou]# iostat -d
Linux 3.10.0-1160.71.1.el7.x86_64 (localhost.localdomain)       08/31/22       _x86_64_ (1 CPU)
 
Device:            tps    kB_read/s    kB_wrtn/s    kB_read    kB_wrtn
scd0              0.04         2.22         0.00       1028          0
sda              21.00       969.38        98.67     449035      45704
dm-0             20.10       942.02        82.49     436363      38211
dm-1              3.95         5.95        13.84       2756       6412
 
[root@localhost shitou]# iostat -N
Linux 3.10.0-1160.71.1.el7.x86_64 (localhost.localdomain)       08/31/22       _x86_64_ (1 CPU)
 
avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           3.08    0.00    4.32    4.11    1.24   87.26
 
Device:            tps    kB_read/s    kB_wrtn/s    kB_read    kB_wrtn
scd0              0.04         2.14         0.00       1028          0
sda              20.24       934.22        95.09     449035      45704
centos-root      19.37       907.86        79.50     436363      38211
centos-swap       3.81         5.73        13.34       2756       6412
 
[root@localhost shitou]# iostat -k
Linux 3.10.0-1160.71.1.el7.x86_64 (localhost.localdomain)       08/31/22       _x86_64_ (1 CPU)
 
avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           2.99    0.00    4.19    3.99    1.20   87.63
 
Device:            tps    kB_read/s    kB_wrtn/s    kB_read    kB_wrtn
scd0              0.04         2.08         0.00       1028          0
sda              19.65       907.03        92.32     449035      45705
dm-0             18.81       881.43        77.19     436363      38213
dm-1              3.69         5.57        12.95       2756       6412
 
[root@localhost shitou]# iostat -m 以M为单位显示所有信息
Linux 3.10.0-1160.71.1.el7.x86_64 (localhost.localdomain)       08/31/22       _x86_64_ (1 CPU)
 
avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           2.96    0.00    4.16    3.96    1.19   87.72
 
Device:            tps    MB_read/s    MB_wrtn/s    MB_read    MB_wrtn
scd0              0.04         0.00         0.00          1          0
sda              19.54         0.88         0.09        438         44
dm-0             18.71         0.85         0.07        426         37
dm-1              3.66         0.01         0.01          2          6
 
[root@localhost shitou]# iostat -dm
Linux 3.10.0-1160.71.1.el7.x86_64 (localhost.localdomain)       08/31/22       _x86_64_ (1 CPU)
 
Device:            tps    MB_read/s    MB_wrtn/s    MB_read    MB_wrtn
scd0              0.04         0.00         0.00          1          0
sda              19.05         0.86         0.09        438         44
dm-0             18.23         0.83         0.07        426         37
dm-1              3.57         0.01         0.01          2          6
 
[root@localhost shitou]# iostat -t    报告每秒向终端读取和写入的字符数 
Linux 3.10.0-1160.71.1.el7.x86_64 (localhost.localdomain)       08/31/22       _x86_64_ (1 CPU)
 
08/31/22 20:52:23
avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           2.79    0.00    3.91    3.72    1.12   88.46
 
Device:            tps    kB_read/s    kB_wrtn/s    kB_read    kB_wrtn
scd0              0.03         1.93         0.00       1028          0
sda              18.36       845.58        86.02     449435      45721
dm-0             17.57       821.74        71.93     436763      38229
dm-1              3.44         5.19        12.06       2756       6412
 
[root@localhost shitou]# iostat -v
Usage: iostat [ options ] [ <interval> [ <count> ] ]
Options are:
[ -c ] [ -d ] [ -h ] [ -k | -m ] [ -N ] [ -t ] [ -V ] [ -x ] [ -y ] [ -z ]
[ -j { ID | LABEL | PATH | UUID | ... } ]
[ [ -T ] -g <group_name> ] [ -p [ <device> [,...] | ALL ] ]
[ <device> [...] | ALL ]
[root@localhost shitou]# iostat -V
sysstat version 10.1.5
(C) Sebastien Godard (sysstat <at> orange.fr)
[root@localhost shitou]# iostat -p
Linux 3.10.0-1160.71.1.el7.x86_64 (localhost.localdomain)       08/31/22       _x86_64_ (1 CPU)
 
avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           2.65    0.00    3.71    3.53    1.06   89.05
 
Device:            tps    kB_read/s    kB_wrtn/s    kB_read    kB_wrtn
scd0              0.03         1.83         0.00       1028          0
sda              17.41       801.76        81.57     449435      45722
sda1              0.57        11.15         3.69       6252       2068
sda2             16.52       787.85        77.88     441639      43654
dm-0             16.67       779.15        68.20     436763      38231
dm-1              3.26         4.92        11.44       2756       6412
 
[root@localhost shitou]# iostat -d -k 1 1查看TPS和吞吐量信息
Linux 3.10.0-1160.71.1.el7.x86_64 (localhost.localdomain)       08/31/22       _x86_64_ (1 CPU)
 
Device:            tps    kB_read/s    kB_wrtn/s    kB_read    kB_wrtn
scd0              0.02         1.12         0.00       1028          0
sda              10.63       488.61        49.73     449791      45783
dm-0             10.17       474.84        41.60     437119      38298
dm-1              1.99         2.99         6.97       2756       6412
 
iostat -d -x -k 1 1      查看设备使用率(%util)、响应时间(await)
[root@localhost shitou]# iostat -d -x -k 1 1
Linux 3.10.0-1160.71.1.el7.x86_64 (localhost.localdomain)       08/31/22       _x86_64_ (1 CPU)
 
Device:         rrqm/s   wrqm/s     r/s     w/s    rkB/s    wkB/s avgrq-sz avgqu-sz   await r_await w_await  svctm  %util
scd0              0.00     0.00    0.02    0.00     1.06     0.00   114.22     0.00   23.22   23.22    0.00  15.22   0.03
sda               0.10     1.79    8.69    1.40   462.38    47.02   100.98     0.17   16.61   11.88   45.93   5.26   5.31
dm-0              0.00     0.00    8.12    1.54   449.36    39.34   101.19     0.18   18.31   12.53   48.72   5.41   5.22
dm-1              0.00     0.00    0.24    1.65     2.84     6.58    10.02     0.03   14.30    6.01   15.49   0.63   0.12
说明:
 
tps:每秒钟发送到的I/O请求数。
Blk_read/s:每秒读取的block数。
Blk_wrtn/s:每秒写入的block数。
Blk_read:读入的block总数。
Blk_wrtn:写入的block总数。
rrqm/s: 每秒进行 merge 的读操作数目。即 rmerge/s
wrqm/s: 每秒进行 merge 的写操作数目。即 wmerge/s
r/s: 每秒完成的读 I/O 设备次数。即 rio/s
w/s: 每秒完成的写 I/O 设备次数。即 wio/s
rkB/s: 每秒读K字节数。是 rsect/s 的一半,因为每扇区大小为512字节。
wkB/s: 每秒写K字节数。是 wsect/s 的一半。
avgrq-sz: 平均每次设备I/O操作的数据大小 (扇区)。
avgqu-sz: 平均I/O队列长度。
rsec/s: 每秒读扇区数。即 rsect/s
wsec/s: 每秒写扇区数。即 wsect/s
r_await:每个读操作平均所需的时间
不仅包括硬盘设备读操作的时间,还包括了在kernel队列中等待的时间。
w_await:每个写操作平均所需的时间
不仅包括硬盘设备写操作的时间,还包括了在kernel队列中等待的时间。
await: 平均每次设备I/O操作的等待时间 (毫秒)。
svctm: 平均每次设备I/O操作的服务时间 (毫秒)。
%util: 一秒中有百分之多少的时间用于 I/O 操作,即被io消耗的cpu百分比
备注:
如果 %util 接近 100%,说明产生的I/O请求太多,
I/O系统已经满负荷,该磁盘可能存在瓶颈。如果 svctm 
比较接近 await,说明 I/O 几乎没有等待时间;如果 await 
远大于 svctm,说明I/O 队列太长,io响应太慢,则需要进行必要优化。
如果avgqu-sz比较大,也表示有当量io在等待。
[root@localhost shitou]# iostat -c 1 2
Linux 3.10.0-1160.71.1.el7.x86_64 (localhost.localdomain)       08/31/22       _x86_64_ (1 CPU)
 
avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           1.45    0.00    2.04    1.91    0.57   94.04
 
avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           0.00    0.00    0.00    0.00    0.00  100.00
 
 
 

iostat 1 5
间隔1秒,总共显示5次

iostat -d 2
每隔2秒,显示一次设备统计信息.

iostat -d 2 3
每隔2秒,显示一次设备统计信息.总共输出3次.

iostat -x sda sdb 2 3
每隔2秒显示一次sda, sdb两个设备的扩展统计信息,共输出3次.

iostat -p sda 2 3
每隔2秒显示一次sda及上面所有分区的统计信息,共输出3次.

iostat是Linux中被用来监控系统的I/O设备活动情况的工具,是input/output statistics的缩写。它可以生成三种类型的报告:

CPU利用率报告
设备利用率报告
网络文件系统报告

iostat通过生成的报告来帮助管理员更好的调整系统设置来平衡各个物理磁盘之间的I/O负载

netstat [-acCeFghilMnNoprstuvVwx][-A<网络类型>][--ip]

-a或--all 显示所有连线中的Socket。
-A<网络类型>或--<网络类型> 列出该网络类型连线中的相关地址。
-c或--continuous 持续列出网络状态。
-C或--cache 显示路由器配置的快取信息。
-e或--extend 显示网络其他相关信息。
-F或--fib 显示路由缓存。
-g或--groups 显示多重广播功能群组组员名单。
-h或--help 在线帮助。
-i或--interfaces 显示网络界面信息表单。
-l或--listening 显示监控中的服务器的Socket。
-M或--masquerade 显示伪装的网络连线。
-n或--numeric 直接使用IP地址,而不通过域名服务器。
-N或--netlink或--symbolic 显示网络硬件外围设备的符号连接名称。
-o或--timers 显示计时器。
-p或--programs 显示正在使用Socket的程序识别码和程序名称。
-r或--route 显示Routing Table。
-s或--statistics 显示网络工作信息统计表。
-t或--tcp 显示TCP传输协议的连线状况。
-u或--udp 显示UDP传输协议的连线状况。
-v或--verbose 显示指令执行过程。
-V或--version 显示版本信息。
-w或--raw 显示RAW传输协议的连线状况。
-x或--unix 此参数的效果和指定"-A unix"参数相同。
--ip或--inet 此参数的效果和指定"-A inet"参数相同

netstat -a 显示当前网络状况

[root@localhost shitou]# netstat -a
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 0.0.0.0:ssh             0.0.0.0:*               LISTEN
tcp        0      0 localhost:smtp          0.0.0.0:*               LISTEN
tcp        0      0 localhost.localdoma:ssh gateway:57842           ESTABLISHED
tcp        0     48 localhost.localdoma:ssh gateway:57840           ESTABLISHED
tcp6       0      0 [::]:mysql              [::]:*                  LISTEN
tcp6       0      0 [::]:ssh                [::]:*                  LISTEN
tcp6       0      0 localhost:smtp          [::]:*                  LISTEN
udp        0      0 localhost:323           0.0.0.0:*
udp6       0      0 localhost:323           [::]:*
Active UNIX domain sockets (servers and established)
Proto RefCnt Flags       Type       State         I-Node   Path
unix  2      [ ACC ]     STREAM     LISTENING     12035    /run/lvm/lvmpolld.socket
unix  2      [ ACC ]     STREAM     LISTENING     18391    private/proxywrite
unix  2      [ ACC ]     STREAM     LISTENING     18382    private/verify
unix  2      [ ACC ]     STREAM     LISTENING     18370    private/rewrite
unix  2      [ ACC ]     STREAM     LISTENING     18409    private/discard
unix  2      [ ACC ]     STREAM     LISTENING     18379    private/trace
unix  3      [ ]         DGRAM                    7465     /run/systemd/notify
unix  2      [ ]         DGRAM                    7467     /run/systemd/cgroups-agent
unix  2      [ ACC ]     STREAM     LISTENING     12076    /run/lvm/lvmetad.socket
unix  2      [ ACC ]     STREAM     LISTENING     7481     /run/systemd/journal/stdout
unix  2      [ ACC ]     STREAM     LISTENING     18415    private/local
unix  5      [ ]         DGRAM                    7484     /run/systemd/journal/socket
 

netstat -nu 显示当前户籍UDP连接状况

 
[root@localhost shitou]# netstat -nu
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State

netstat -apu 显示UDP端口号的使用情况

[root@localhost shitou]# netstat -apu
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
udp        0      0 localhost:323           0.0.0.0:*                           637/chronyd
udp6       0      0 localhost:323           [::]:*                              637/chronyd

netstat -i 显示网卡列表

[root@localhost shitou]# netstat -i
Kernel Interface table
Iface             MTU    RX-OK RX-ERR RX-DRP RX-OVR    TX-OK TX-ERR TX-DRP TX-OVR Flg
eth0             1500     7616      0      0 0           783      0      0      0 BMRU
lo              65536       68      0      0 0            68      0      0      0 LRU
 

netstat -l 显示套接口

[root@localhost shitou]#  netstat -l
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 0.0.0.0:ssh             0.0.0.0:*               LISTEN
tcp        0      0 localhost:smtp          0.0.0.0:*               LISTEN
tcp6       0      0 [::]:mysql              [::]:*                  LISTEN
tcp6       0      0 [::]:ssh                [::]:*                  LISTEN
tcp6       0      0 localhost:smtp          [::]:*                  LISTEN
udp        0      0 localhost:323           0.0.0.0:*
udp6       0      0 localhost:323           [::]:*
Active UNIX domain sockets (only servers)
Proto RefCnt Flags       Type       State         I-Node   Path
unix  2      [ ACC ]     STREAM     LISTENING     12035    /run/lvm/lvmpolld.socket
unix  2      [ ACC ]     STREAM     LISTENING     18391    private/proxywrite
unix  2      [ ACC ]     STREAM     LISTENING     18382    private/verify
unix  2      [ ACC ]     STREAM     LISTENING     18370    private/rewrite
unix  2      [ ACC ]     STREAM     LISTENING     18409    private/discard
unix  2      [ ACC ]     STREAM     LISTENING     18379    private/trace
unix  2      [ ACC ]     STREAM     LISTENING     12076    /run/lvm/lvmetad.socket
unix  2      [ ACC ]     STREAM     LISTENING     7481     /run/systemd/journal/stdout
unix  2      [ ACC ]     STREAM     LISTENING     18415    private/local
unix  2      [ ACC ]     STREAM     LISTENING     18373    private/bounce
unix  2      [ ACC ]     STREAM     LISTENING     18388    private/proxymap
unix  2      [ ACC ]     STREAM     LISTENING     18394    private/smtp
unix  2      [ ACC ]     STREAM     LISTENING     18397    private/relay
unix  2      [ ACC ]     STREAM     LISTENING     18403    private/error
unix  2      [ ACC ]     STREAM     LISTENING     18406    private/retry
unix  2      [ ACC ]     STREAM     LISTENING     18358    public/cleanup
unix  2      [ ACC ]     SEQPACKET  LISTENING     12421    /run/udev/control
unix  2      [ ACC ]     STREAM     LISTENING     18418    private/virtual
unix  2      [ ACC ]     STREAM     LISTENING     18421    private/lmtp
unix  2      [ ACC ]     STREAM     LISTENING     18424    private/anvil
unix  2      [ ACC ]     STREAM     LISTENING     18427    private/scache
unix  2      [ ACC ]     STREAM     LISTENING     18363    public/qmgr
unix  2      [ ACC ]     STREAM     LISTENING     18400    public/showq
unix  2      [ ACC ]     STREAM     LISTENING     18354    public/pickup
unix  2      [ ACC ]     STREAM     LISTENING     18376    private/defer
unix  2      [ ACC ]     STREAM     LISTENING     18385    public/flush
unix  2      [ ACC ]     STREAM     LISTENING     11989    /run/systemd/private
unix  2      [ ACC ]     STREAM     LISTENING     18367    private/tlsmgr
unix  2      [ ACC ]     STREAM     LISTENING     14318    /run/dbus/system_bus_socket
unix  2      [ ACC ]     STREAM     LISTENING     18567    /tmp/mysql.sock
[root@localhost shitou]#
 

netstat -s显示网络信息

[root@localhost shitou]#  netstat -s
Ip:
    951 total packets received
    0 forwarded
    0 incoming packets discarded
    907 incoming packets delivered
    802 requests sent out
    16 outgoing packets dropped
Icmp:
    34 ICMP messages received
    0 input ICMP message failed.
    ICMP input histogram:
        destination unreachable: 34
    34 ICMP messages sent
    0 ICMP messages failed
    ICMP output histogram:
        destination unreachable: 34
IcmpMsg:
        InType3: 34
        OutType3: 34
Tcp:
    4 active connections openings
    2 passive connection openings
    0 failed connection attempts
    0 connection resets received
    2 connections established
    641 segments received
    505 segments send out
    15 segments retransmited
    0 bad segments received.
    0 resets sent
Udp:
    198 packets received
    34 packets to unknown port received.
    0 packet receive errors
    248 packets sent
    0 receive buffer errors
    0 send buffer errors
UdpLite:
TcpExt:
    3 TCP sockets finished time wait in fast timer
    7 delayed acks sent
    2 packets directly queued to recvmsg prequeue.
    1 bytes directly received in process context from prequeue
    232 packet headers predicted
    98 acknowledgments not containing data payload received
    163 predicted acknowledgments
    2 other TCP timeouts
    TCPLossProbes: 2
    1 DSACKs received
    1 connections aborted due to timeout
    TCPSackShiftFallback: 2
    TCPRcvCoalesce: 66
    TCPOrigDataSent: 324
IpExt:
    InNoRoutes: 5
    InBcastPkts: 32
    InOctets: 461684
    OutOctets: 73749
    InBcastOctets: 3596
    InNoECTPkts: 958