{"id":2737,"date":"2022-12-20T15:17:10","date_gmt":"2022-12-20T18:17:10","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/lnstat-man8\/"},"modified":"2022-12-20T15:17:10","modified_gmt":"2022-12-20T18:17:10","slug":"lnstat-man8","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/lnstat-man8\/","title":{"rendered":"LNSTAT (man8)"},"content":{"rendered":"<h1 align=\"center\">LNSTAT<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#OPTIONS\">OPTIONS<\/a><br \/> <a href=\"#USAGE EXAMPLES\">USAGE EXAMPLES<\/a><br \/> <a href=\"#FILES\">FILES<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a><br \/> <a href=\"#AUTHOR\">AUTHOR<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">lnstat \u2212 unified linux network statistics<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>lnstat<\/b> [<i>options<\/i>]<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">This manual page documents briefly the <b>lnstat<\/b> command.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>lnstat<\/b> 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\/.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Each file in \/proc\/net\/stat\/ contains a header line listing the column names. These names are used by <b>lnstat<\/b> 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. <b>lnstat<\/b> sums these values up (which in fact are counters) before printing them. After each interval, only the difference to the last value is printed.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Files and columns may be selected by using the <b>-f<\/b> and <b>-k<\/b> parameters. By default, all columns of all files are printed.<\/p>\n<h2>OPTIONS <a name=\"OPTIONS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">lnstat supports the following options. <b><br \/> \u2212h, \u2212\u2212help<\/b><\/p>\n<p style=\"margin-left:22%;\">Show summary of options.<\/p>\n<p style=\"margin-left:11%;\"><b>\u2212V, \u2212\u2212version<\/b><\/p>\n<p style=\"margin-left:22%;\">Show version of program.<\/p>\n<p style=\"margin-left:11%;\"><b>\u2212c, \u2212\u2212count <count><\/b><\/p>\n<p style=\"margin-left:22%;\">Print <count> number of intervals.<\/p>\n<p style=\"margin-left:11%;\"><b>\u2212d, \u2212\u2212dump<\/b><\/p>\n<p style=\"margin-left:22%;\">Dump list of available files\/keys.<\/p>\n<p style=\"margin-left:11%;\"><b>\u2212f, \u2212\u2212file <file><\/b><\/p>\n<p style=\"margin-left:22%;\">Statistics file to use, may be specified multiple times. By default all files in \/proc\/net\/stat are scanned.<\/p>\n<p style=\"margin-left:11%;\"><b>\u2212i, \u2212\u2212interval <intv><\/b><\/p>\n<p style=\"margin-left:22%;\">Set interval to \u2019intv\u2019 seconds.<\/p>\n<p style=\"margin-left:11%;\"><b>\u2212j, \u2212\u2212json<\/b><\/p>\n<p style=\"margin-left:22%;\">Display results in JSON format<\/p>\n<p style=\"margin-left:11%;\"><b>\u2212k, \u2212\u2212keys k,k,k,&#8230;<\/b><\/p>\n<p style=\"margin-left:22%;\">Display only keys specified. Each key <b>k<\/b> is of the form <b>[file:]key<\/b>. If <b><file><\/b> is given, the search for the given key is limited to that file. Otherwise the first file containing the searched key is being used.<\/p>\n<p style=\"margin-left:11%;\"><b>\u2212s, \u2212\u2212subject [0-2]<\/b><\/p>\n<p style=\"margin-left:22%;\">Specify display of subject\/header. \u20190\u2019 means no header at all, \u20191\u2019 prints a header only at start of the program and \u20192\u2019 prints a header every 20 lines.<\/p>\n<p style=\"margin-left:11%;\"><b>\u2212w, \u2212\u2212width n,n,n,&#8230;<\/b><\/p>\n<p style=\"margin-left:22%;\">Width for each field.<\/p>\n<h2>USAGE EXAMPLES <a name=\"USAGE EXAMPLES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b># lnstat -d<\/b><\/p>\n<p style=\"margin-left:22%;\">Get a list of supported statistics files.<\/p>\n<p style=\"margin-left:11%;\"><b># lnstat -k arp_cache:entries,rt_cache:in_hit,arp_cache:destroys<\/b><\/p>\n<p style=\"margin-left:22%;\">Select the specified files and keys.<\/p>\n<p style=\"margin-left:11%;\"><b># lnstat -i 10<\/b><\/p>\n<p style=\"margin-left:22%;\">Use an interval of 10 seconds.<\/p>\n<p style=\"margin-left:11%;\"><b># lnstat -f ip_conntrack<\/b><\/p>\n<p style=\"margin-left:22%;\">Use only the specified file for statistics.<\/p>\n<p style=\"margin-left:11%;\"><b># lnstat -s 0<\/b><\/p>\n<p style=\"margin-left:22%;\">Do not print a header at all.<\/p>\n<p style=\"margin-left:11%;\"><b># lnstat -s 20<\/b><\/p>\n<p style=\"margin-left:22%;\">Print a header at start and every 20 lines.<\/p>\n<p style=\"margin-left:11%;\"><b># lnstat -c -1 -i 1 -f rt_cache -k entries,in_hit,in_slow_tot<\/b><\/p>\n<p style=\"margin-left:22%;\">Display statistics for keys entries, in_hit and in_slow_tot of field rt_cache every second.<\/p>\n<h2>FILES <a name=\"FILES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>\/proc\/net\/stat\/arp_cache, \/proc\/net\/stat\/ndisc_cache<\/b><\/p>\n<p style=\"margin-left:22%;\">Statistics around neighbor cache and ARP. <b>arp_cache<\/b> is for IPv4, <b>ndisc_cache<\/b> is the same for IPv6.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>entries<\/b> Number of entries in the neighbor table.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>allocs<\/b> How many neighbor entries have been allocated.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>destroys<\/b> How many neighbor entries have been removed.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>hash_grows<\/b> How often the neighbor (hash) table was increased.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>lookups<\/b> How many lookups were performed.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>hits<\/b> How many <b>lookups<\/b> were successful.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>res_failed<\/b> How many neighbor lookups failed.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>rcv_probes_mcast<\/b> How many multicast neighbor solicitations were received. (IPv6 only.)<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>rcv_probes_ucast<\/b> How many unicast neighbor solicitations were received. (IPv6 only.)<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>periodic_gc_runs<\/b> How many garbage collection runs were executed.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>forced_gc_runs<\/b> How many forced garbage collection runs were executed. Happens when adding an entry and the table is too full.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>unresolved_discards<\/b> How many neighbor table entries were discarded due to lookup failure.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>table_fulls<\/b> Number of table overflows. Happens if table is full and forced GC run (see <b>forced_gc_runs<\/b>) has failed.<\/p>\n<p style=\"margin-left:11%;\"><b>\/proc\/net\/stat\/ip_conntrack, \/proc\/net\/stat\/nf_conntrack<\/b><\/p>\n<p style=\"margin-left:22%;\">Conntrack related counters. <b>ip_conntrack<\/b> is for backwards compatibility with older userspace only and shows the same data as <b>nf_conntrack<\/b>.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>entries<\/b> Number of entries in conntrack table.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>searched<\/b> Number of conntrack table lookups performed.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>found<\/b> Number of <b>searched<\/b> entries which were successful.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>new<\/b> Number of conntrack entries added which were not expected before.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>invalid<\/b> Number of packets seen which can not be tracked.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>ignore<\/b> Number of packets seen which are already connected to a conntrack entry.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>delete<\/b> Number of conntrack entries which were removed.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>delete_list<\/b> Number of conntrack entries which were put to dying list.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>insert<\/b> Number of entries inserted into the list.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>insert_failed<\/b> Number of entries for which list insertion was attempted but failed (happens if the same entry is already present).<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>drop<\/b> Number of packets dropped due to conntrack failure. Either new conntrack entry allocation failed, or protocol helper dropped the packet.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>early_drop<\/b> Number of dropped conntrack entries to make room for new ones, if maximum table size was reached.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>icmp_error<\/b> Number of packets which could not be tracked due to error situation. This is a subset of <b>invalid<\/b>.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>expect_new<\/b> Number of conntrack entries added after an expectation for them was already present.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>expect_create<\/b> Number of expectations added.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>expect_delete<\/b> Number of expectations deleted.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>search_restart<\/b> Number of conntrack table lookups which had to be restarted due to hashtable resizes.<\/p>\n<p style=\"margin-left:11%;\"><b>\/proc\/net\/stat\/rt_cache<\/b><\/p>\n<p style=\"margin-left:22%;\">Routing cache statistics.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>entries<\/b> Number of entries in routing cache.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>in_hit<\/b> Number of route cache hits for incoming packets. Deprecated since IP route cache removal, therefore always zero.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>in_slow_tot<\/b> Number of routing cache entries added for input traffic.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>in_slow_mc<\/b> Number of multicast routing cache entries added for input traffic.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>in_no_route<\/b> Number of input packets for which no routing table entry was found.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>in_brd<\/b> Number of matched input broadcast packets.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>in_martian_dst<\/b> Number of incoming martian destination packets.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>in_martian_src<\/b> Number of incoming martian source packets.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>out_hit<\/b> Number of route cache hits for outgoing packets. Deprecated since IP route cache removal, therefore always zero.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>out_slow_tot<\/b> Number of routing cache entries added for output traffic.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>out_slow_mc<\/b> Number of multicast routing cache entries added for output traffic.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>gc_total<\/b> Total number of garbage collection runs. Deprecated since IP route cache removal, therefore always zero.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>gc_ignored<\/b> 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.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>gc_goal_miss<\/b> Number of garbage collector goal misses. Deprecated since IP route cache removal, therefore always zero.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>gc_dst_overflow<\/b> Number of destination cache overflows. Deprecated since IP route cache removal, therefore always zero.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>in_hlist_search<\/b> Number of hash table list traversals for input traffic. Deprecated since IP route cache removal, therefore always zero.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>out_hlist_search<\/b> Number of hash table list traversals for output traffic. Deprecated since IP route cache removal, therefore always zero.<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>ip<\/b>(8)<\/p>\n<h2>AUTHOR <a name=\"AUTHOR\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">lnstat was written by Harald Welte <laforge@gnumonks.org>.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">This manual page was written by Michael Prokop <mika@grml.org> for the Debian project (but may be used by others).<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  lnstat \u2212 unified linux network statistics <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[5,52,91,4],"class_list":["post-2737","post","type-post","status-publish","format-standard","hentry","category-8-administracion-del-sistema","tag-5","tag-administracion","tag-lnstat","tag-man8"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/2737","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=2737"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/2737\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=2737"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=2737"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=2737"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}