]> git.proxmox.com Git - mirror_iproute2.git/blame - README.lnstat
ip: bridge: add xstats json support
[mirror_iproute2.git] / README.lnstat
CommitLineData
32673013
SH
1lnstat - linux networking statistics
2(C) 2004 Harald Welte <laforge@gnumonks.org
3======================================================================
4
5This tool is a generalized and more feature-complete replacement for the old
6'rtstat' program.
7
8In addition to routing cache statistics, it supports any kind of statistics
9the linux kernel exports via a file in /proc/net/stat. In a stock 2.6.9
e5cd5a51
SH
10kernel, this is
11 per-protocol neighbour cache statistics
738aebe5 12 (ipv4, ipv6, atm)
32673013
SH
13 routing cache statistics
14 (ipv4)
15 connection tracking statistics
16 (ipv4)
17
18Please note that lnstat will adopt to any additional statistics that might be
19added to the kernel at some later point
20
21I personally always like examples more than any reference documentation, so I
22list the following examples. If somebody wants to do a manpage, feel free
23to send me a patch :)
24
25EXAMPLES:
26
27In order to get a list of supported statistics files, you can run
28
29 lnstat -d
30
31It will display something like
e5cd5a51 32
32673013
SH
33/proc/net/stat/arp_cache:
34 1: entries
35 2: allocs
36 3: destroys
37[...]
38/proc/net/stat/rt_cache:
39 1: entries
40 2: in_hit
41 3: in_slow_tot
42
43You can now select the files/keys you are interested by something like
44
45 lnstat -k arp_cache:entries,rt_cache:in_hit,arp_cache:destroys
46
47arp_cach|rt_cache|arp_cach|
48 entries| in_hit|destroys|
49 6| 6| 0|
50 6| 0| 0|
51 6| 2| 0|
52
53
54You can specify the interval (e.g. 10 seconds) by:
e5cd5a51 55
32673013
SH
56 lnstat -i 10
57
58You can specify to only use one particular statistics file:
59
60 lnstat -f ip_conntrack
61
e5cd5a51 62You can specify individual field widths
32673013
SH
63
64 lnstat -k arp_cache:entries,rt_cache:entries -w 20,8
65
66You can specify not to print a header at all
e5cd5a51 67
32673013
SH
68 lnstat -s 0
69
70You can specify to print a header only at start of the program
71
72 lnstat -s 1
73
74You can specify to print a header at start and every 20 lines:
75
76 lnstat -s 20
77
78You can specify the number of samples you want to take (e.g. 5):
32673013 79
e5cd5a51 80 lnstat -c 5