Linux常用命令-nstat

命令

nstat

描述

network statistics tools
查看网络统计信息

用法

1
nstat [OPTION] [ PATTERN [ PATTERN ] ]

选项

1
2
3
4
5
6
7
8
9
10
11
12
13
14
Options:
-a, --ignore 忽略历史文件数据,即显示当前的数据,否则显示为增量数据
-d, --scan=SECS 指定每几秒抽样一次统计数据,注意默认为后台运行
-e, --errors 显示错误
-j, --json 显示为JSON格式
-n, --nooutput 不显示任何输出,只更新历史文件
-p, --pretty 优化显示格式
-r, --reset 重置历史
-s, --noupdate 不要更新历史
-t, --interval=SECS 显示过去几秒钟的平均值
-z, --zeros 显示活动为零的条目
-x, --extended=TYPE 显示指定类型的扩展统计信息,TYPE参数cpu_hits

默认历史文件路径/tmp/.nstat.u$UID,如/tmp/.nstat.u0

注意

示例

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
$ nstat -V
nstat utility, iproute2-ss170501

$ nstat -a
#kernel
IpInReceives 1110927 0.0
IpInDelivers 1110915 0.0
IpOutRequests 990318 0.0
IpOutDiscards 2 0.0
IpOutNoRoutes 16 0.0
IcmpInMsgs 674 0.0
IcmpInErrors 19 0.0
IcmpInDestUnreachs 543 0.0
IcmpInRedirects 16 0.0
IcmpInEchos 113 0.0
IcmpInEchoReps 2 0.0
IcmpOutMsgs 560 0.0
IcmpOutDestUnreachs 464 0.0
IcmpOutEchos 2 0.0
IcmpOutEchoReps 94 0.0
IcmpMsgInType0 2 0.0
IcmpMsgInType3 543 0.0
IcmpMsgInType5 16 0.0
IcmpMsgInType8 113 0.0
IcmpMsgOutType0 94 0.0
IcmpMsgOutType3 464 0.0
IcmpMsgOutType8 2 0.0
TcpActiveOpens 5537 0.0
TcpPassiveOpens 5850 0.0
TcpAttemptFails 25 0.0
TcpEstabResets 52 0.0
TcpInSegs 1033879 0.0
TcpOutSegs 1177814 0.0
TcpRetransSegs 189 0.0
TcpInErrs 1 0.0
TcpOutRsts 738 0.0
UdpInDatagrams 45503 0.0
UdpNoPorts 253 0.0
UdpOutDatagrams 49287 0.0
Ip6InReceives 30704 0.0
Ip6InDelivers 14486 0.0
Ip6OutRequests 14560 0.0
Ip6OutDiscards 11 0.0
Ip6InMcastPkts 16288 0.0
Ip6OutMcastPkts 28995 0.0
Ip6InOctets 2211512 0.0
Ip6OutOctets 1048432 0.0
Ip6InMcastOctets 1172800 0.0
Ip6OutMcastOctets 2087224 0.0
Ip6InNoECTPkts 30704 0.0
Icmp6InMsgs 14486 0.0
Icmp6OutMsgs 14560 0.0
Icmp6InEchos 14 0.0
Icmp6InEchoReplies 12 0.0
Icmp6InGroupMembQueries 14389 0.0
Icmp6InNeighborSolicits 1 0.0
Icmp6InNeighborAdvertisements 70 0.0
Icmp6OutEchos 12 0.0
Icmp6OutEchoReplies 14 0.0
Icmp6OutGroupMembResponses 14389 0.0
Icmp6OutGroupMembReductions 11 0.0
Icmp6OutRouterSolicits 45 0.0
Icmp6OutNeighborSolicits 14 0.0
Icmp6OutNeighborAdvertisements 1 0.0
Icmp6OutMLDv2Reports 74 0.0
Icmp6InType128 14 0.0
Icmp6InType129 12 0.0
Icmp6InType130 14389 0.0
Icmp6InType135 1 0.0
Icmp6InType136 70 0.0
Icmp6OutType128 12 0.0
Icmp6OutType129 14 0.0
Icmp6OutType131 14389 0.0
Icmp6OutType132 11 0.0
Icmp6OutType133 45 0.0
Icmp6OutType135 14 0.0
Icmp6OutType136 1 0.0
Icmp6OutType143 74 0.0
TcpExtSyncookiesFailed 17 0.0
TcpExtEmbryonicRsts 16 0.0
TcpExtTW 5671 0.0
TcpExtDelayedACKs 5267 0.0
TcpExtDelayedACKLocked 91 0.0
TcpExtDelayedACKLost 818 0.0
TcpExtTCPPrequeued 79 0.0
TcpExtTCPDirectCopyFromPrequeue 4889 0.0
TcpExtTCPHPHits 362547 0.0
TcpExtTCPHPHitsToUser 10 0.0
TcpExtTCPPureAcks 231266 0.0
TcpExtTCPHPAcks 191586 0.0
TcpExtTCPSackRecovery 7 0.0
TcpExtTCPDSACKUndo 4 0.0
TcpExtTCPLossUndo 9 0.0
TcpExtTCPSackFailures 7 0.0
TcpExtTCPFastRetrans 23 0.0
TcpExtTCPForwardRetrans 9 0.0
TcpExtTCPSlowStartRetrans 1 0.0
TcpExtTCPTimeouts 16 0.0
TcpExtTCPLossProbes 107 0.0
TcpExtTCPLossProbeRecovery 23 0.0
TcpExtTCPDSACKOldSent 818 0.0
TcpExtTCPDSACKRecv 89 0.0
TcpExtTCPAbortOnData 3 0.0
TcpExtTCPAbortOnTimeout 12 0.0
TcpExtTCPDSACKIgnoredNoUndo 56 0.0
TcpExtTCPSackShifted 2 0.0
TcpExtTCPSackMerged 2 0.0
TcpExtTCPSackShiftFallback 54 0.0
TcpExtTCPDeferAcceptDrop 25 0.0
TcpExtTCPRetransFail 2 0.0
TcpExtTCPRcvCoalesce 236334 0.0
TcpExtTCPOFOQueue 15692 0.0
TcpExtTCPChallengeACK 1 0.0
TcpExtTCPSYNChallenge 1 0.0
TcpExtTCPSpuriousRtxHostQueues 5 0.0
TcpExtTCPAutoCorking 121425 0.0
TcpExtTCPFromZeroWindowAdv 2 0.0
TcpExtTCPToZeroWindowAdv 2 0.0
TcpExtTCPWantZeroWindowAdv 168 0.0
TcpExtTCPSynRetrans 5 0.0
TcpExtTCPOrigDataSent 650387 0.0
TcpExtTCPHystartTrainDetect 114 0.0
TcpExtTCPHystartTrainCwnd 2313 0.0
TcpExtTCPHystartDelayDetect 3 0.0
TcpExtTCPHystartDelayCwnd 129 0.0
TcpExtTCPACKSkippedSeq 1 0.0
IpExtInMcastPkts 14389 0.0
IpExtInBcastPkts 16158 0.0
IpExtInOctets 1695219725 0.0
IpExtOutOctets 1377437957 0.0
IpExtInMcastOctets 460448 0.0
IpExtInBcastOctets 3212025 0.0
IpExtInNoECTPkts 1536356 0.0