1LNSTAT(8) System Manager's Manual LNSTAT(8)
2
3
4
6 lnstat - unified linux network statistics
7
9 lnstat [options]
10
12 This manual page documents briefly the lnstat command.
13
14 lnstat is a generalized and more feature-complete replacement for the
15 old rtstat program. It is commonly used to periodically print a selec‐
16 tion of statistical values exported by the kernel. In addition to
17 routing cache statistics, it supports any kind of statistics the linux
18 kernel exports via a file in /proc/net/stat/.
19
20 Each file in /proc/net/stat/ contains a header line listing the column
21 names. These names are used by lnstat as keys for selecting which sta‐
22 tistics to print. For every CPU present in the system, a line follows
23 which lists the actual values for each column of the file. lnstat sums
24 these values up (which in fact are counters) before printing them.
25 After each interval, only the difference to the last value is printed.
26
27 Files and columns may be selected by using the -f and -k parameters. By
28 default, all columns of all files are printed.
29
31 lnstat supports the following options.
32
33 -h, --help
34 Show summary of options.
35
36 -V, --version
37 Show version of program.
38
39 -c, --count <count>
40 Print <count> number of intervals.
41
42 -d, --dump
43 Dump list of available files/keys.
44
45 -f, --file <file>
46 Statistics file to use, may be specified multiple times. By
47 default all files in /proc/net/stat are scanned.
48
49 -i, --interval <intv>
50 Set interval to 'intv' seconds.
51
52 -j, --json
53 Display results in JSON format
54
55 -k, --keys k,k,k,...
56 Display only keys specified. Each key k is of the form
57 [file:]key. If <file> is given, the search for the given key is
58 limited to that file. Otherwise the first file containing the
59 searched key is being used.
60
61 -s, --subject [0-2]
62 Specify display of subject/header. '0' means no header at all,
63 '1' prints a header only at start of the program and '2' prints
64 a header every 20 lines.
65
66 -w, --width n,n,n,...
67 Width for each field.
68
70 # lnstat -d
71 Get a list of supported statistics files.
72
73 # lnstat -k arp_cache:entries,rt_cache:in_hit,arp_cache:destroys
74 Select the specified files and keys.
75
76 # lnstat -i 10
77 Use an interval of 10 seconds.
78
79 # lnstat -f ip_conntrack
80 Use only the specified file for statistics.
81
82 # lnstat -s 0
83 Do not print a header at all.
84
85 # lnstat -s 20
86 Print a header at start and every 20 lines.
87
88 # lnstat -c -1 -i 1 -f rt_cache -k entries,in_hit,in_slow_tot
89 Display statistics for keys entries, in_hit and in_slow_tot of
90 field rt_cache every second.
91
92
94 /proc/net/stat/arp_cache, /proc/net/stat/ndisc_cache
95 Statistics around neighbor cache and ARP. arp_cache is for IPv4,
96 ndisc_cache is the same for IPv6.
97
98 entries Number of entries in the neighbor table.
99
100 allocs How many neighbor entries have been allocated.
101
102 destroys How many neighbor entries have been removed.
103
104 hash_grows How often the neighbor (hash) table was increased.
105
106 lookups How many lookups were performed.
107
108 hits How many lookups were successful.
109
110 res_failed How many neighbor lookups failed.
111
112 rcv_probes_mcast How many multicast neighbor solicitations were
113 received. (IPv6 only.)
114
115 rcv_probes_ucast How many unicast neighbor solicitations were
116 received. (IPv6 only.)
117
118 periodic_gc_runs How many garbage collection runs were executed.
119
120 forced_gc_runs How many forced garbage collection runs were exe‐
121 cuted. Happens when adding an entry and the table is too full.
122
123 unresolved_discards How many neighbor table entries were dis‐
124 carded due to lookup failure.
125
126 table_fulls Number of table overflows. Happens if table is full
127 and forced GC run (see forced_gc_runs) has failed.
128
129
130 /proc/net/stat/ip_conntrack, /proc/net/stat/nf_conntrack
131 Conntrack related counters. ip_conntrack is for backwards com‐
132 patibility with older userspace only and shows the same data as
133 nf_conntrack.
134
135 entries Number of entries in conntrack table.
136
137 searched Number of conntrack table lookups performed.
138
139 found Number of searched entries which were successful.
140
141 new Number of conntrack entries added which were not expected
142 before.
143
144 invalid Number of packets seen which can not be tracked.
145
146 ignore Number of packets seen which are already connected to a
147 conntrack entry.
148
149 delete Number of conntrack entries which were removed.
150
151 delete_list Number of conntrack entries which were put to dying
152 list.
153
154 insert Number of entries inserted into the list.
155
156 insert_failed Number of entries for which list insertion was
157 attempted but failed (happens if the same entry is already
158 present).
159
160 drop Number of packets dropped due to conntrack failure. Either
161 new conntrack entry allocation failed, or protocol helper
162 dropped the packet.
163
164 early_drop Number of dropped conntrack entries to make room for
165 new ones, if maximum table size was reached.
166
167 icmp_error Number of packets which could not be tracked due to
168 error situation. This is a subset of invalid.
169
170 expect_new Number of conntrack entries added after an expecta‐
171 tion for them was already present.
172
173 expect_create Number of expectations added.
174
175 expect_delete Number of expectations deleted.
176
177 search_restart Number of conntrack table lookups which had to be
178 restarted due to hashtable resizes.
179
180
181 /proc/net/stat/rt_cache
182 Routing cache statistics.
183
184 entries Number of entries in routing cache.
185
186 in_hit Number of route cache hits for incoming packets. Depre‐
187 cated since IP route cache removal, therefore always zero.
188
189 in_slow_tot Number of routing cache entries added for input
190 traffic.
191
192 in_slow_mc Number of multicast routing cache entries added for
193 input traffic.
194
195 in_no_route Number of input packets for which no routing table
196 entry was found.
197
198 in_brd Number of matched input broadcast packets.
199
200 in_martian_dst Number of incoming martian destination packets.
201
202 in_martian_src Number of incoming martian source packets.
203
204 out_hit Number of route cache hits for outgoing packets. Depre‐
205 cated since IP route cache removal, therefore always zero.
206
207 out_slow_tot Number of routing cache entries added for output
208 traffic.
209
210 out_slow_mc Number of multicast routing cache entries added for
211 output traffic.
212
213 gc_total Total number of garbage collection runs. Deprecated
214 since IP route cache removal, therefore always zero.
215
216 gc_ignored Number of ignored garbage collection runs due to min‐
217 imum GC interval not reached and routing cache not full. Depre‐
218 cated since IP route cache removal, therefore always zero.
219
220 gc_goal_miss Number of garbage collector goal misses. Deprecated
221 since IP route cache removal, therefore always zero.
222
223 gc_dst_overflow Number of destination cache overflows. Depre‐
224 cated since IP route cache removal, therefore always zero.
225
226 in_hlist_search Number of hash table list traversals for input
227 traffic. Deprecated since IP route cache removal, therefore
228 always zero.
229
230 out_hlist_search Number of hash table list traversals for output
231 traffic. Deprecated since IP route cache removal, therefore
232 always zero.
233
234
236 ip(8)
237
239 lnstat was written by Harald Welte <laforge@gnumonks.org>.
240
241 This manual page was written by Michael Prokop <mika@grml.org> for the
242 Debian project (but may be used by others).
243
244
245
246 LNSTAT(8)