NAME
lnstat - unified linux network statistics
SYNOPSIS
lnstat [options]
DESCRIPTION
This manual page documents briefly the lnstat command. lnstat 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/. Each file in /proc/net/stat/ contains a header line listing the column names. These names are used by lnstat 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. lnstat sums these values up (which in fact are counters) before printing them. After each interval, only the difference to the last value is printed. Files and columns may be selected by using the -f and -k parameters. By default, all columns of all files are printed.
OPTIONS
lnstat supports the following options. -h, --help Show summary of options. -V, --version Show version of program. -c, --count <count> Print <count> number of intervals. -d, --dump Dump list of available files/keys. -f, --file <file> Statistics file to use, may be specified multiple times. By default all files in /proc/net/stat are scanned. -i, --interval <intv> Set interval to 'intv' seconds. -j, --json Display results in JSON format -k, --keys k,k,k,... Display only keys specified. Each key k is of the form [file:]key. If <file> is given, the search for the given key is limited to that file. Otherwise the first file containing the searched key is being used. -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. -w, --width n,n,n,... Width for each field.
USAGE EXAMPLES
# lnstat -d Get a list of supported statistics files. # lnstat -k arp_cache:entries,rt_cache:in_hit,arp_cache:destroys Select the specified files and keys. # lnstat -i 10 Use an interval of 10 seconds. # lnstat -f ip_conntrack Use only the specified file for statistics. # lnstat -s 0 Do not print a header at all. # lnstat -s 20 Print a header at start and every 20 lines. # 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.
FILES
/proc/net/stat/arp_cache, /proc/net/stat/ndisc_cache Statistics around neighbor cache and ARP. arp_cache is for IPv4, ndisc_cache is the same for IPv6. entries Number of entries in the neighbor table. allocs How many neighbor entries have been allocated. destroys How many neighbor entries have been removed. hash_grows How often the neighbor (hash) table was increased. lookups How many lookups were performed. hits How many lookups were successful. res_failed How many neighbor lookups failed. rcv_probes_mcast How many multicast neighbor solicitations were received. (IPv6 only.) rcv_probes_ucast How many unicast neighbor solicitations were received. (IPv6 only.) periodic_gc_runs How many garbage collection runs were executed. forced_gc_runs How many forced garbage collection runs were executed. Happens when adding an entry and the table is too full. unresolved_discards How many neighbor table entries were discarded due to lookup failure. table_fulls Number of table overflows. Happens if table is full and forced GC run (see forced_gc_runs) has failed. /proc/net/stat/ip_conntrack, /proc/net/stat/nf_conntrack Conntrack related counters. ip_conntrack is for backwards compatibility with older userspace only and shows the same data as nf_conntrack. entries Number of entries in conntrack table. searched Number of conntrack table lookups performed. found Number of searched entries which were successful. new Number of conntrack entries added which were not expected before. invalid Number of packets seen which can not be tracked. ignore Number of packets seen which are already connected to a conntrack entry. delete Number of conntrack entries which were removed. delete_list Number of conntrack entries which were put to dying list. insert Number of entries inserted into the list. insert_failed Number of entries for which list insertion was attempted but failed (happens if the same entry is already present). drop Number of packets dropped due to conntrack failure. Either new conntrack entry allocation failed, or protocol helper dropped the packet. early_drop Number of dropped conntrack entries to make room for new ones, if maximum table size was reached. icmp_error Number of packets wich could not be tracked due to error situation. This is a subset of invalid. expect_new Number of conntrack entries added after an expectation for them was already present. expect_create Number of expectations added. expect_delete Number of expectations deleted. search_restart Number of conntrack table lookups which had to be restarted due to hashtable resizes. /proc/net/stat/rt_cache Routing cache statistics. entries Number of entries in routing cache. in_hit Number of route cache hits for incoming packets. Deprecated since IP route cache removal, therefore always zero. in_slow_tot Number of routing cache entries added for input traffic. in_slow_mc Number of multicast routing cache entries added for input traffic. in_no_route Number of input packets for which no routing table entry was found. in_brd Number of matched input broadcast packets. in_martian_dst Number of incoming martian destination packets. in_martian_src Number of incoming martian source packets. out_hit Number of route cache hits for outgoing packets. Deprecated since IP route cache removal, therefore always zero. out_slow_tot Number of routing cache entries added for output traffic. out_slow_mc Number of multicast routing cache entries added for output traffic. gc_total Total number of garbage collection runs. Deprecated since IP route cache removal, therefore always zero. 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. gc_goal_miss Number of garbage collector goal misses. Deprecated since IP route cache removal, therefore always zero. gc_dst_overflow Number of destination cache overflows. Deprecated since IP route cache removal, therefore always zero. in_hlist_search Number of hash table list traversals for input traffic. Deprecated since IP route cache removal, therefore always zero. out_hlist_search Number of hash table list traversals for output traffic. Deprecated since IP route cache removal, therefore always zero.
SEE ALSO
ip(8), and /usr/share/doc/iproute-doc/README.lnstat (package iproute- doc on Debian)
AUTHOR
lnstat was written by Harald Welte <laforge@gnumonks.org>. This manual page was written by Michael Prokop <mika@grml.org> for the Debian project (but may be used by others). LNSTAT(8)
More Linux Commands
manpages/FcFreeTypeCharIndex.3.html
FcFreeTypeCharIndex(3) - map Unicode to glyph id (Man Page)
Maps a Unicode char to a glyph index. This function uses information from several possible underlying encoding tables to work around broken fonts. As a result,
manpages/wgetn_wstr.3ncurses.html
wgetn_wstr(3ncurses) - get an array of wide characters from
The effect of get_wstr is as though a series of calls to get_wch were made, until a newline, other end-of-line, or end-of-file condition is processed. An end-of
manpages/md5.1ssl.html
md5(1ssl) message digests (Commands - Linux manual page)....
The digest functions output the message digest of a supplied file or files in hexadecimal. The digest functions also generate and verify digital signatures usin
manpages/XtScreenDatabase.3.html
XtScreenDatabase(3) - initialize, open, or close a display
The XtDisplayInitialize function builds the resource database, calls the Xlib XrmParseCommand function to parse the command line, and performs other per display
manpages/XtAppUnlock.3.html
XtAppUnlock(3) - lock and unlock application context........
XtAppLock locks the application context including all its related displays and widgets. XtAppUnlock unlocks the application context. SEE ALSO X Toolkit Intrinsi
manpages/freehostent.3.html
freehostent(3) - get network hostnames and addresses........
These functions are deprecated (and unavailable in glibc). Use getaddrinfo(3) and getnameinfo(3) instead. The getipnodebyname() and getipnodebyaddr() functions
manpages/gnutls_pkcs11_token_get_info.3.html
gnutls_pkcs11_token_get_info(3) - API function (Man Page)...
This function will return information about the PKCS 11 token such as the label, id, etc. RETURNS GNUTLS_E_SUCCESS (0) on success or a negative error code on er
manpages/git-archive.1.html
git-archive(1) - Create an archive of files from a named tre
Creates an archive of the specified format containing the tree structure for the named tree, and writes it out to the standard output. If <prefix> is specified
manpages/XSetWindowColormap.3.html
XSetWindowColormap(3) - change window attributes (Man Page)
Depending on the valuemask, the XChangeWindowAttributes function uses the window attributes in the XSetWindowAttributes structure to change the specified window
manpages/tk_focusPrev.n.html
tk_focusPrev(n) - Utility procedures for managing the input
tk_focusNext is a utility procedure used for keyboard traversal. It returns the next window after window in focus order. The focus order is determined by the st
manpages/cbreak.3ncurses.html
cbreak(3ncurses) - curses input options - Linux manual page
Normally, the tty driver buffers typed characters until a newline or carriage return is typed. The cbreak routine disables line buffering and erase/kill charact
manpages/listbox.n.html
listbox(n) - Create and manipulate listbox widgets (ManPage)
The listbox command creates a new window (given by the pathName argument) and makes it into a listbox widget. Additional options, described above, may be specif
