| 1 |
.TH LNSTAT 8 |
| 2 |
.SH NAME |
| 3 |
lnstat \- unified Linux network statistics |
| 4 |
.SH SYNOPSIS |
| 5 |
.B lnstat |
| 6 |
.RI [ options ] |
| 7 |
.SH DESCRIPTION |
| 8 |
This manual page documents briefly the |
| 9 |
.B lnstat |
| 10 |
command. |
| 11 |
.PP |
| 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/. |
| 17 |
.PP |
| 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. |
| 24 |
.PP |
| 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. |
| 27 |
.SH OPTIONS |
| 28 |
lnstat supports the following options. |
| 29 |
.TP |
| 30 |
.B \-h, \-\-help |
| 31 |
Show summary of options. |
| 32 |
.TP |
| 33 |
.B \-V, \-\-version |
| 34 |
Show version of program. |
| 35 |
.TP |
| 36 |
.B \-c, \-\-count <count> |
| 37 |
Print <count> number of intervals. |
| 38 |
.TP |
| 39 |
.B \-d, \-\-dump |
| 40 |
Dump list of available files/keys. |
| 41 |
.TP |
| 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. |
| 44 |
.TP |
| 45 |
.B \-i, \-\-interval <intv> |
| 46 |
Set interval to 'intv' seconds. |
| 47 |
.TP |
| 48 |
.B \-j, \-\-json |
| 49 |
Display results in JSON format. |
| 50 |
.TP |
| 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 used. |
| 55 |
.TP |
| 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. |
| 58 |
.TP |
| 59 |
.B \-w, \-\-width n,n,n,... |
| 60 |
Width for each field. |
| 61 |
.SH USAGE EXAMPLES |
| 62 |
.TP |
| 63 |
.B # lnstat -d |
| 64 |
Get a list of supported statistics files. |
| 65 |
.TP |
| 66 |
.B # lnstat -k arp_cache:entries,rt_cache:in_hit,arp_cache:destroys |
| 67 |
Select the specified files and keys. |
| 68 |
.TP |
| 69 |
.B # lnstat -i 10 |
| 70 |
Use an interval of 10 seconds. |
| 71 |
.TP |
| 72 |
.B # lnstat -f ip_conntrack |
| 73 |
Use only the specified file for statistics. |
| 74 |
.TP |
| 75 |
.B # lnstat -s 0 |
| 76 |
Do not print a header at all. |
| 77 |
.TP |
| 78 |
.B # lnstat -s 20 |
| 79 |
Print a header at start and every 20 lines. |
| 80 |
.TP |
| 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. |
| 83 |
|
| 84 |
.SH FILES |
| 85 |
.TP |
| 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. |
| 88 |
.sp |
| 89 |
.B entries |
| 90 |
Number of entries in the neighbor table. |
| 91 |
.sp |
| 92 |
.B allocs |
| 93 |
How many neighbor entries have been allocated. |
| 94 |
.sp |
| 95 |
.B destroys |
| 96 |
How many neighbor entries have been removed. |
| 97 |
.sp |
| 98 |
.B hash_grows |
| 99 |
How often the neighbor (hash) table was increased. |
| 100 |
.sp |
| 101 |
.B lookups |
| 102 |
How many lookups were performed. |
| 103 |
.sp |
| 104 |
.B hits |
| 105 |
How many \fBlookups\fP were successful. |
| 106 |
.sp |
| 107 |
.B res_failed |
| 108 |
How many neighbor lookups failed. |
| 109 |
.sp |
| 110 |
.B rcv_probes_mcast |
| 111 |
How many multicast neighbor solicitations were received. (IPv6 only.) |
| 112 |
.sp |
| 113 |
.B rcv_probes_ucast |
| 114 |
How many unicast neighbor solicitations were received. (IPv6 only.) |
| 115 |
.sp |
| 116 |
.B periodic_gc_runs |
| 117 |
How many garbage collection runs were executed. |
| 118 |
.sp |
| 119 |
.B forced_gc_runs |
| 120 |
How many forced garbage collection runs were executed. Happens when adding an |
| 121 |
entry and the table is too full. |
| 122 |
.sp |
| 123 |
.B unresolved_discards |
| 124 |
How many neighbor table entries were discarded due to lookup failure. |
| 125 |
.sp |
| 126 |
.B table_fulls |
| 127 |
Number of table overflows. Happens if table is full and forced GC run (see |
| 128 |
\fBforced_gc_runs\fP) has failed. |
| 129 |
|
| 130 |
.TP |
| 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. |
| 134 |
.sp |
| 135 |
.B entries |
| 136 |
Number of entries in conntrack table. |
| 137 |
.sp |
| 138 |
.B searched |
| 139 |
Number of conntrack table lookups performed. |
| 140 |
.sp |
| 141 |
.B found |
| 142 |
Number of \fBsearched\fP entries which were successful. |
| 143 |
.sp |
| 144 |
.B new |
| 145 |
Number of conntrack entries added which were not expected before. |
| 146 |
.sp |
| 147 |
.B invalid |
| 148 |
Number of packets seen which cannot be tracked. |
| 149 |
.sp |
| 150 |
.B ignore |
| 151 |
Number of packets seen which are already connected to a conntrack entry. |
| 152 |
.sp |
| 153 |
.B delete |
| 154 |
Number of conntrack entries which were removed. |
| 155 |
.sp |
| 156 |
.B delete_list |
| 157 |
Number of conntrack entries which were put to dying list. |
| 158 |
.sp |
| 159 |
.B insert |
| 160 |
Number of entries inserted into the list. |
| 161 |
.sp |
| 162 |
.B insert_failed |
| 163 |
Number of entries for which list insertion was attempted but failed (happens if |
| 164 |
the same entry is already present). |
| 165 |
.sp |
| 166 |
.B drop |
| 167 |
Number of packets dropped due to conntrack failure. Either new conntrack entry |
| 168 |
allocation failed, or protocol helper dropped the packet. |
| 169 |
.sp |
| 170 |
.B early_drop |
| 171 |
Number of dropped conntrack entries to make room for new ones, if maximum table |
| 172 |
size was reached. |
| 173 |
.sp |
| 174 |
.B icmp_error |
| 175 |
Number of packets which could not be tracked due to error situation. This is a |
| 176 |
subset of \fBinvalid\fP. |
| 177 |
.sp |
| 178 |
.B expect_new |
| 179 |
Number of conntrack entries added after an expectation for them was already |
| 180 |
present. |
| 181 |
.sp |
| 182 |
.B expect_create |
| 183 |
Number of expectations added. |
| 184 |
.sp |
| 185 |
.B expect_delete |
| 186 |
Number of expectations deleted. |
| 187 |
.sp |
| 188 |
.B search_restart |
| 189 |
Number of conntrack table lookups which had to be restarted due to hashtable |
| 190 |
resizes. |
| 191 |
|
| 192 |
.TP |
| 193 |
.B /proc/net/stat/rt_cache |
| 194 |
Routing cache statistics. |
| 195 |
.sp |
| 196 |
.B entries |
| 197 |
Number of entries in routing cache. |
| 198 |
.sp |
| 199 |
.B in_hit |
| 200 |
Number of route cache hits for incoming packets. Deprecated since IP route |
| 201 |
cache removal, therefore always zero. |
| 202 |
.sp |
| 203 |
.B in_slow_tot |
| 204 |
Number of routing cache entries added for input traffic. |
| 205 |
.sp |
| 206 |
.B in_slow_mc |
| 207 |
Number of multicast routing cache entries added for input traffic. |
| 208 |
.sp |
| 209 |
.B in_no_route |
| 210 |
Number of input packets for which no routing table entry was found. |
| 211 |
.sp |
| 212 |
.B in_brd |
| 213 |
Number of matched input broadcast packets. |
| 214 |
.sp |
| 215 |
.B in_martian_dst |
| 216 |
Number of incoming martian destination packets. |
| 217 |
.sp |
| 218 |
.B in_martian_src |
| 219 |
Number of incoming martian source packets. |
| 220 |
.sp |
| 221 |
.B out_hit |
| 222 |
Number of route cache hits for outgoing packets. Deprecated since IP route |
| 223 |
cache removal, therefore always zero. |
| 224 |
.sp |
| 225 |
.B out_slow_tot |
| 226 |
Number of routing cache entries added for output traffic. |
| 227 |
.sp |
| 228 |
.B out_slow_mc |
| 229 |
Number of multicast routing cache entries added for output traffic. |
| 230 |
.sp |
| 231 |
.B gc_total |
| 232 |
Total number of garbage collection runs. Deprecated since IP route cache |
| 233 |
removal, therefore always zero. |
| 234 |
.sp |
| 235 |
.B gc_ignored |
| 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. |
| 239 |
.sp |
| 240 |
.B gc_goal_miss |
| 241 |
Number of garbage collector goal misses. Deprecated since IP route cache |
| 242 |
removal, therefore always zero. |
| 243 |
.sp |
| 244 |
.B gc_dst_overflow |
| 245 |
Number of destination cache overflows. Deprecated since IP route cache removal, |
| 246 |
therefore always zero. |
| 247 |
.sp |
| 248 |
.B in_hlist_search |
| 249 |
Number of hash table list traversals for input traffic. Deprecated since IP |
| 250 |
route cache removal, therefore always zero. |
| 251 |
.sp |
| 252 |
.B out_hlist_search |
| 253 |
Number of hash table list traversals for output traffic. Deprecated since IP |
| 254 |
route cache removal, therefore always zero. |
| 255 |
|
| 256 |
.SH SEE ALSO |
| 257 |
.BR ip (8) |
| 258 |
.br |
| 259 |
.SH AUTHOR |
| 260 |
lnstat was written by Harald Welte <[email protected]>. |
| 261 |
.PP |
| 262 |
This manual page was written by Michael Prokop <[email protected]> for the Debian project (but may be used by others). |