summaryrefslogtreecommitdiffstats
path: root/man/man8/lnstat.8
blob: b98241bf56f5c3d3bca5fd563e3184519f74d84b (plain)
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
.TH LNSTAT 8
.SH NAME
lnstat \- unified linux network statistics
.SH SYNOPSIS
.B lnstat
.RI [ options ]
.SH DESCRIPTION
This manual page documents briefly the
.B lnstat
command.
.PP
\fBlnstat\fP is a generalized and more feature-complete replacement for the old
rtstat program. It is commonly used to periodically print a selection of
statistical values exported by the kernel.
In addition to routing cache statistics, it supports any kind of statistics the
linux kernel exports via a file in /proc/net/stat/.
.PP
Each file in /proc/net/stat/ contains a header line listing the column names.
These names are used by \fBlnstat\fP as keys for selecting which statistics to
print. For every CPU present in the system, a line follows which lists the
actual values for each column of the file. \fBlnstat\fP sums these values up
(which in fact are counters) before printing them. After each interval, only
the difference to the last value is printed.
.PP
Files and columns may be selected by using the \fB-f\fP and \fB-k\fP
parameters. By default, all columns of all files are printed.
.SH OPTIONS
lnstat supports the following options.
.TP
.B \-h, \-\-help
Show summary of options.
.TP
.B \-V, \-\-version
Show version of program.
.TP
.B \-c, \-\-count <count>
Print <count> number of intervals.
.TP
.B \-d, \-\-dump
Dump list of available files/keys.
.TP
.B \-f, \-\-file <file>
Statistics file to use, may be specified multiple times. By default all files in /proc/net/stat are scanned.
.TP
.B \-i, \-\-interval <intv>
Set interval to 'intv' seconds.
.TP
.B \-j, \-\-json
Display results in JSON format
.TP
.B \-k, \-\-keys k,k,k,...
Display only keys specified. Each key \fBk\fP is of the form \fB[file:]key\fP. If \fB<file>\fP
is given, the search for the given key is limited to that file. Otherwise the first file containing
the searched key is being used.
.TP
.B \-s, \-\-subject [0-2]
Specify display of subject/header. '0' means no header at all, '1' prints a header only at start of the program and '2' prints a header every 20 lines.
.TP
.B \-w, \-\-width n,n,n,...
Width for each field.
.SH USAGE EXAMPLES
.TP
.B # lnstat -d
Get a list of supported statistics files.
.TP
.B # lnstat -k arp_cache:entries,rt_cache:in_hit,arp_cache:destroys
Select the specified files and keys.
.TP
.B # lnstat -i 10
Use an interval of 10 seconds.
.TP
.B # lnstat -f ip_conntrack
Use only the specified file for statistics.
.TP
.B # lnstat -s 0
Do not print a header at all.
.TP
.B # lnstat -s 20
Print a header at start and every 20 lines.
.TP
.B # lnstat -c -1 -i 1 -f rt_cache -k entries,in_hit,in_slow_tot
Display statistics for keys entries, in_hit and in_slow_tot of field rt_cache every second.

.SH FILES
.TP
.B /proc/net/stat/arp_cache, /proc/net/stat/ndisc_cache
Statistics around neighbor cache and ARP. \fBarp_cache\fP is for IPv4, \fBndisc_cache\fP is the same for IPv6.
.sp
.B entries
Number of entries in the neighbor table.
.sp
.B allocs
How many neighbor entries have been allocated.
.sp
.B destroys
How many neighbor entries have been removed.
.sp
.B hash_grows
How often the neighbor (hash) table was increased.
.sp
.B lookups
How many lookups were performed.
.sp
.B hits
How many \fBlookups\fP were successful.
.sp
.B res_failed
How many neighbor lookups failed.
.sp
.B rcv_probes_mcast
How many multicast neighbor solicitations were received. (IPv6 only.)
.sp
.B rcv_probes_ucast
How many unicast neighbor solicitations were received. (IPv6 only.)
.sp
.B periodic_gc_runs
How many garbage collection runs were executed.
.sp
.B forced_gc_runs
How many forced garbage collection runs were executed. Happens when adding an
entry and the table is too full.
.sp
.B unresolved_discards
How many neighbor table entries were discarded due to lookup failure.
.sp
.B table_fulls
Number of table overflows. Happens if table is full and forced GC run (see
\fBforced_gc_runs\fP) has failed.

.TP
.B /proc/net/stat/ip_conntrack, /proc/net/stat/nf_conntrack
Conntrack related counters. \fBip_conntrack\fP is for backwards compatibility
with older userspace only and shows the same data as \fBnf_conntrack\fP.
.sp
.B entries
Number of entries in conntrack table.
.sp
.B searched
Number of conntrack table lookups performed.
.sp
.B found
Number of \fBsearched\fP entries which were successful.
.sp
.B new
Number of conntrack entries added which were not expected before.
.sp
.B invalid
Number of packets seen which can not be tracked.
.sp
.B ignore
Number of packets seen which are already connected to a conntrack entry.
.sp
.B delete
Number of conntrack entries which were removed.
.sp
.B delete_list
Number of conntrack entries which were put to dying list.
.sp
.B insert
Number of entries inserted into the list.
.sp
.B insert_failed
Number of entries for which list insertion was attempted but failed (happens if
the same entry is already present).
.sp
.B drop
Number of packets dropped due to conntrack failure. Either new conntrack entry
allocation failed, or protocol helper dropped the packet.
.sp
.B early_drop
Number of dropped conntrack entries to make room for new ones, if maximum table
size was reached.
.sp
.B icmp_error
Number of packets which could not be tracked due to error situation. This is a
subset of \fBinvalid\fP.
.sp
.B expect_new
Number of conntrack entries added after an expectation for them was already
present.
.sp
.B expect_create
Number of expectations added.
.sp
.B expect_delete
Number of expectations deleted.
.sp
.B search_restart
Number of conntrack table lookups which had to be restarted due to hashtable
resizes.

.TP
.B /proc/net/stat/rt_cache
Routing cache statistics.
.sp
.B entries
Number of entries in routing cache.
.sp
.B in_hit
Number of route cache hits for incoming packets. Deprecated since IP route
cache removal, therefore always zero.
.sp
.B in_slow_tot
Number of routing cache entries added for input traffic.
.sp
.B in_slow_mc
Number of multicast routing cache entries added for input traffic.
.sp
.B in_no_route
Number of input packets for which no routing table entry was found.
.sp
.B in_brd
Number of matched input broadcast packets.
.sp
.B in_martian_dst
Number of incoming martian destination packets.
.sp
.B in_martian_src
Number of incoming martian source packets.
.sp
.B out_hit
Number of route cache hits for outgoing packets. Deprecated since IP route
cache removal, therefore always zero.
.sp
.B out_slow_tot
Number of routing cache entries added for output traffic.
.sp
.B out_slow_mc
Number of multicast routing cache entries added for output traffic.
.sp
.B gc_total
Total number of garbage collection runs. Deprecated since IP route cache
removal, therefore always zero.
.sp
.B gc_ignored
Number of ignored garbage collection runs due to minimum GC interval not
reached and routing cache not full. Deprecated since IP route cache removal,
therefore always zero.
.sp
.B gc_goal_miss
Number of garbage collector goal misses. Deprecated since IP route cache
removal, therefore always zero.
.sp
.B gc_dst_overflow
Number of destination cache overflows. Deprecated since IP route cache removal,
therefore always zero.
.sp
.B in_hlist_search
Number of hash table list traversals for input traffic. Deprecated since IP
route cache removal, therefore always zero.
.sp
.B out_hlist_search
Number of hash table list traversals for output traffic. Deprecated since IP
route cache removal, therefore always zero.

.SH SEE ALSO
.BR ip (8)
.br
.SH AUTHOR
lnstat was written by Harald Welte <laforge@gnumonks.org>.
.PP
This manual page was written by Michael Prokop <mika@grml.org> for the Debian project (but may be used by others).