3 lnstat \- unified linux network statistics
8 This manual page documents briefly the
12 \fBlnstat\fP is a generalized and more feature-complete replacement for the old
13 rtstat program. It is commonly used to periodically print a selection of
14 statistical values exported by the kernel.
15 In addition to routing cache statistics, it supports any kind of statistics the
16 linux kernel exports via a file in /proc/net/stat/.
18 Each file in /proc/net/stat/ contains a header line listing the column names.
19 These names are used by \fBlnstat\fP as keys for selecting which statistics to
20 print. For every CPU present in the system, a line follows which lists the
21 actual values for each column of the file. \fBlnstat\fP sums these values up
22 (which in fact are counters) before printing them. After each interval, only
23 the difference to the last value is printed.
25 Files and columns may be selected by using the \fB-f\fP and \fB-k\fP
26 parameters. By default, all columns of all files are printed.
28 lnstat supports the following options.
31 Show summary of options.
34 Show version of program.
36 .B \-c, \-\-count <count>
37 Print <count> number of intervals.
40 Dump list of available files/keys.
42 .B \-f, \-\-file <file>
43 Statistics file to use, may be specified multiple times. By default all files in /proc/net/stat are scanned.
45 .B \-i, \-\-interval <intv>
46 Set interval to 'intv' seconds.
49 Display results in JSON format
51 .B \-k, \-\-keys k,k,k,...
52 Display only keys specified. Each key \fBk\fP is of the form \fB[file:]key\fP. If \fB<file>\fP
53 is given, the search for the given key is limited to that file. Otherwise the first file containing
54 the searched key is being used.
56 .B \-s, \-\-subject [0-2]
57 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.
59 .B \-w, \-\-width n,n,n,...
64 Get a list of supported statistics files.
66 .B # lnstat -k arp_cache:entries,rt_cache:in_hit,arp_cache:destroys
67 Select the specified files and keys.
70 Use an interval of 10 seconds.
72 .B # lnstat -f ip_conntrack
73 Use only the specified file for statistics.
76 Do not print a header at all.
79 Print a header at start and every 20 lines.
81 .B # lnstat -c -1 -i 1 -f rt_cache -k entries,in_hit,in_slow_tot
82 Display statistics for keys entries, in_hit and in_slow_tot of field rt_cache every second.
86 .B /proc/net/stat/arp_cache, /proc/net/stat/ndisc_cache
87 Statistics around neighbor cache and ARP. \fBarp_cache\fP is for IPv4, \fBndisc_cache\fP is the same for IPv6.
90 Number of entries in the neighbor table.
93 How many neighbor entries have been allocated.
96 How many neighbor entries have been removed.
99 How often the neighbor (hash) table was increased.
102 How many lookups were performed.
105 How many \fBlookups\fP were successful.
108 How many neighbor lookups failed.
111 How many multicast neighbor solicitations were received. (IPv6 only.)
114 How many unicast neighbor solicitations were received. (IPv6 only.)
117 How many garbage collection runs were executed.
120 How many forced garbage collection runs were executed. Happens when adding an
121 entry and the table is too full.
123 .B unresolved_discards
124 How many neighbor table entries were discarded due to lookup failure.
127 Number of table overflows. Happens if table is full and forced GC run (see
128 \fBforced_gc_runs\fP) has failed.
131 .B /proc/net/stat/ip_conntrack, /proc/net/stat/nf_conntrack
132 Conntrack related counters. \fBip_conntrack\fP is for backwards compatibility
133 with older userspace only and shows the same data as \fBnf_conntrack\fP.
136 Number of entries in conntrack table.
139 Number of conntrack table lookups performed.
142 Number of \fBsearched\fP entries which were successful.
145 Number of conntrack entries added which were not expected before.
148 Number of packets seen which can not be tracked.
151 Number of packets seen which are already connected to a conntrack entry.
154 Number of conntrack entries which were removed.
157 Number of conntrack entries which were put to dying list.
160 Number of entries inserted into the list.
163 Number of entries for which list insertion was attempted but failed (happens if
164 the same entry is already present).
167 Number of packets dropped due to conntrack failure. Either new conntrack entry
168 allocation failed, or protocol helper dropped the packet.
171 Number of dropped conntrack entries to make room for new ones, if maximum table
175 Number of packets which could not be tracked due to error situation. This is a
176 subset of \fBinvalid\fP.
179 Number of conntrack entries added after an expectation for them was already
183 Number of expectations added.
186 Number of expectations deleted.
189 Number of conntrack table lookups which had to be restarted due to hashtable
193 .B /proc/net/stat/rt_cache
194 Routing cache statistics.
197 Number of entries in routing cache.
200 Number of route cache hits for incoming packets. Deprecated since IP route
201 cache removal, therefore always zero.
204 Number of routing cache entries added for input traffic.
207 Number of multicast routing cache entries added for input traffic.
210 Number of input packets for which no routing table entry was found.
213 Number of matched input broadcast packets.
216 Number of incoming martian destination packets.
219 Number of incoming martian source packets.
222 Number of route cache hits for outgoing packets. Deprecated since IP route
223 cache removal, therefore always zero.
226 Number of routing cache entries added for output traffic.
229 Number of multicast routing cache entries added for output traffic.
232 Total number of garbage collection runs. Deprecated since IP route cache
233 removal, therefore always zero.
236 Number of ignored garbage collection runs due to minimum GC interval not
237 reached and routing cache not full. Deprecated since IP route cache removal,
238 therefore always zero.
241 Number of garbage collector goal misses. Deprecated since IP route cache
242 removal, therefore always zero.
245 Number of destination cache overflows. Deprecated since IP route cache removal,
246 therefore always zero.
249 Number of hash table list traversals for input traffic. Deprecated since IP
250 route cache removal, therefore always zero.
253 Number of hash table list traversals for output traffic. Deprecated since IP
254 route cache removal, therefore always zero.
260 lnstat was written by Harald Welte <laforge@gnumonks.org>.
262 This manual page was written by Michael Prokop <mika@grml.org> for the Debian project (but may be used by others).