System Administration Commands flowstat(1M) NAME flowstat - report flow statistics SYNOPSIS flowstat show [-r | -t] [-i interval] [-s] [-h] [-l link[,...]] [flow[,...]] flowstat show [-w] [-H] [-k] [-p] [-i interval] [-s] [-h] [ -o [- | +] field[,...]] [-l link[,...]] [flow[,...]] flowstat show -g [-w] [-H] [-k] [-i interval] [ -o [- | +] field[,...]] [-l link[,...]] [flow[,...]] flowstat show-history [-a] -f filename [-d] [-F format] [-s time] [-e time] [flow[,...]] flowstat reset [-l link[,...]] [flow[,...]] DESCRIPTION The flowstat command reports run time statistics about user defined flows. flowadm show-flow lists the flow names input to this command. SUBCOMMANDS The following subcommands are supported: flowstat show [-r | -t] [-i interval] [-s] [-h] [-l link[,...]] [flow[,...]] Iteratively examines all flows and reports statistics. The output is sorted in descending order of flow utilization. If no flow is specified, the system displays statistics for all flows. -i interval Used to specify an interval, in seconds, at which statistics would be refreshed. Default interval is one second. -r Display receive side statistics only. Includes bytes and packets received, hardware and software drops etc. See examples for complete listing. -t Display transmit side statistics only. Includes bytes and packets sent, drops etc. See examples below. -s Display per software lane statistics. See examples below. -h Display per hardware lane statistics. See examples below. -l link[,...] Display information for all flows on the named link(s). flowstat show [-w] [-H] [-k] [-p] [-i interval] [-s] [-h] [ -o [- | +] field[,...]] [-l link[,...]] [flow[,...]] Detailed view of the statistics. Supports choosing specific statistics to display. -w Overprints the reports in full screen mode rather than printing reports one below another. -H Print output header after every interval. -k Displays all supported statistics for the specified flow(s) or all flow(s) on specified link(s). -p Display using a stable machine-parseable format. -o - or -o + are not compatible with this option. However, -o fields[,...] works fine with it. -i interval Used to specify an interval, in seconds, at which statistics would be refreshed. Default interval is one second. -s Display per software lane statistics. See examples below. -h Display per hardware lane statistics. See examples below. -o [- | +] field[,...] When invoked without suboption - or +, it provides a way to select specific output fields one is interested in. The field name must be one of the fields listed below, or the special value all to display all supported fields. List of rx side fields: iusedby ibytes ierrors ipktchainsize0-10 ipktchainsize10-50 ipktchainsize50+ iavgqlen ipktdrop ipktsize0-64 ipktsize64-256 ipktsize256-1024 ipktsize1024+ ibwctl_pktdrop intrcpu pollcpu intrcount pollcount In addition, following fields are supported for rx side: in displays ipackets, ibytes, ierrors, ipktdrop displays additional column iusedby when invoked with -h ipktchainsize displays ipktchainsize0-10, ipktchainsize10-50, ipktchainsize50+ ipktsize displays ipktsize0-64, ipktsize64-256, ipktsize256-1024, ipktsize1024+ intrpollcount displays intrcpu, pollcpu, intrcount, pollcount iavgqlen, ipktdrop List of tx side fields: opackets obytes oerrors opktchainsize0-10 opktchainsize10-50 opktchainsize50+ oavgqlen opktdrop opktsize0-64 opktsize64-256 opktsize256-1024 opktsize1024+ obwctl_pktdrop In addition, following fields are supported for tx side: out displays opackets, obytes, oerrors opktchainsize displays opktchainsize0-10, opktchainsize10-50, opktchainsize50+ opktsize displays opktsize0-64, opktsize64-256, opktsize256-1024, opktsize1024+ - field[,...] Drop the listed fields from the display. It continues to display all other fields that it would have displayed without this option. + field[,...] Add listed fields in the display. It continues to display the fields it would have displayed without this option. flowstat show -g [-w] [-H] [-k] [-i interval] [ -o [- | +] field[,...]] [-l link[,...]] [flow[,...]] Displays aggregate statistics such as percentage of packets received via polling, minimum, maximum and average queue length, packet and chain sizes. See examples for complete list. -w Overprints the reports in full screen mode rather than printing reports one below another. -H Print output header after every interval. -k Displays all supported statistics for the specified flow(s) or all flow(s) on specified link(s). -i interval Used to specify an interval, in seconds over which aggregate statistics would be computed. Default interval is one second. -o field[,...] A case-insensitive, comma-separated list of output fields to display. The field name must be one of the fields listed in the examples below. By default, it displays following fields: link, %rx, %tx, avg_qlen, avg_pktsize avg_chainsize. -o [- | +] field[,...] When invoked without suboption - or +, it provides a way to select specific output fields one is interested in. By default, it displays following fields: link, %rx, %tx, avg_qlen, avg_pktsize avg_chainsize. For complete listing, see examples below. - field[,...] Drop the listed fields from the display. It continues to display all other fields that it would have displayed without this option. + field[,...] Add listed fields in the display. It continues to display the fields it would have displayed without this option. flowstat show-history [-a] -f filename [-d] [-F format] [-s time] [-e time] [flow[,...]] Show the network flow usage history from a stored extended accounting file. Configuration and enabling of net accounting through acctadm(1m) is required. The default output will be the summary of flow usage history of the existing flows for their entire period of time in which extended accounting was enabled. -a Display all historical network usage for the specified period of time while extended accounting is enabled. This includes the usage information for the flows that have already been deleted. -f filename Read extended accounting records of history network flow usage from filename. -d Display the dates for which there is logging information. The date is in the format MM/DD/YYYY. -F format Specifies the output format of the historical network usage information. As of this release, gnuplot is the only supported format. -s time -e time Start and stop times for data display. Time is in the format MM/DD/YYYY,hh:mm:ss. flow[,...] If specified, display the historical network flow usage only for the named flow(s). Otherwise, display historical network usage for all flows. flowstat reset [-l link[,...]] [flow[,...]] Resets the flow statistics counters for the specified flow(s). If invoked without specifying any flow, it resets statistics for all the flows over all the links. -l link[,...] Reset statistics for all flows on the named link(s). EXAMPLES Example 1 Display statistics To display statistics for all the links, enter following command. Statistics are displayed as 3 digit numbers with appropriate unit. Default interval is one second. # flowstat show FLOW LINK IPKTS IBYTES OPKTS OBYTES UTIL flow1 bge0 21.2K 2.1M 0.5K 44.2M 0.0% flow2 nxge0 24.5M 13.6G 3.5M 0.1G 0.0% flow3 ixgbe0 0.0M 0.0M 0.0M 0.0M 0.0% FLOW LINK IPKTS IBYTES OPKTS OBYTES UTIL flow1 bge0 21.6K 2.1M 0.5K 46.2M 0.0% flow2 nxge0 26.5M 26.1G 7.0M 0.3G 0.0% flow3 ixgbe0 0.0M 0.0M 0.0M 0.0M 0.0% . . . . . . . . . . . . . . . . . . . . . Example 2 Display rx side statistics # flowstat show -r FLOW LINK IPKTS IBYTES INTRS POLLS HDRPS SDRPS CH<10 CH10-50 CH>50 UTIL flow1 bge0 21.2K 2.1M 22.3K 78.0 0.0 0.0 57.0 0.0 0.0 0.0% flow2 nxge0 24.5M 13.6G 0.8K 10.7M 0.0 0.0 0.3M 2.96M 32.5K 0.0% flow3 ixgbe0 24.5M 13.6G 0.8K 10.7M 0.0 0.0 0.3M 2.96M 32.5K 0.0% Example 3 Display per Lane rx side statistics # flowstat show -r -h ixgbe0 FLOW:HLNE LINK IPKTS IBYTES INTRS POLLS HDRPS SDRPS CH<10 CH10-50 CH>50 UTIL flow1:0 bge0 24.5M 13.6G 0.8K 10.7M 0.0 0.0 0.3M 2.96M 32.5K 0.0% flow1:1 bge0 24.5M 13.6G 0.8K 10.7M 0.0 0.0 0.3M 2.96M 32.5K 0.0% . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . # flowstat show -r -s FLOW:SLNE LINK IPKTS IBYTES DRPS flow1:0 bge0 24.5M 13.6G 0.8K flow1:1 bge0 24.5M 13.6G 0.8K # flowstat show -r -s -h FLOW:HLNE SLNE LINK IPKTS IBYTES DRPS UTIL flow1:0 0 bge0 24.5M 13.6G 0.8K 0.0% flow1:0 1 bge0 24.5M 13.6G 0.8K 0.0% flow1:0 2 bge0 24.5M 13.6G 0.8K 0.0% flow2:1 0 nxge0 24.5M 13.6G 0.8K 0.0% flow2:1 1 nxge0 24.5M 13.6G 0.8K 0.0% flow2:1 2 nxge0 24.5M 13.6G 0.8K 0.0% . . . . . . . . . . . . . . . . . . . . . Example 4 Display tx side statistics To display Tx side statistics after every 5 seconds: # flowstat show -t 5 FLOW LINK OBYTES OPKTS DROPS FLOWCTL UTIL flow1 bge0 0.0 0.0 0.0 0.0 0.0% flow2 nxge0 0.0 0.0 0.0 0.0 0.0% flow3 ixgbe0 0.0 0.0 0.0 0.0 0.0% FLOW LINK OBYTES OPKTS DROPS FLOWCTL UTIL flow1 bge0 0.0 0.0 0.0 0.0 0.0% flow2 nxge0 0.0 0.0 0.0 0.0 0.0% flow3 ixgbe0 0.0 0.0 0.0 0.0 0.0% . . . . . . . . . . . . . . . . . . . . . Example 5 Display per Lane tx side statistics # flowstat show -t -h flow1 FLOW:HLANE OBYTES OPKTS DROPS FLOWCTL UTIL flow1:0 0.0 0.0 0.0 0.0 0.0% Example 6 Choosing to display statistics of interest Following command will drop packet chain size counts from the default output but would display interrupt and poll cpu associated with each lane. # flowstat show -r -h -o -ipktchainsize, +intrcpu, +pollcpu ixgbe0 FLOW:HLNE LINK IPKTS IBYTES INTRS POLLS HDRPS SDRPS INTRC POLLC UTIL flow1:0 bge0 24.5M 13.6G 0.8K 10.7M 0.0 0.0 0 1 0.0% flow1:1 bge0 24.5M 13.6G 0.8K 10.7M 0.0 0.0 2 3 0.0% . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Example 7 Display all available statistics for all the lanes # flowstat show -h -k -l ixgbe0 flow: flow3 link: ixgbe0 type: tx hlane: 0 opackets 0 obytes 0 oerrors 0 opktchainsize0-10 0 opktchainsize0-50 0 opktchainsize50+ 0 oavgqlen 0 opktdrop 0 opktsize0-64 0 opktsize64-256 0 opktsize256-1024 0 opktsize1024+ 0 workercpu 0 obwctl_pktdrop 0 blockcount 0 unblockcount 0 hlane: 1 ousedby ixgbe0 opackets 0 . . . . . . type: rx hlane: 0 ipackets 0 ibytes 0 ierrors 0 ipktchainsize0-10 0 ipktchainsize10-50 0 ipktchainsize50+ 0 iavgqlen 0 ipktdrop 0 ipktsize0-64 0 ipktsize64-256 0 ipktsize256-1024 0 ipktsize1024+ 0 ibwctl_pktdrop 0 intrcpu 0 pollcpu 0 intrcount 0 pollcount 0 hlane: 1 ipackets 0 . . . . . . Example 8 Display aggregate statistics To display statistics aggregated over 30 seconds time interval: # flowstat show -g -i 30 nxge0 FLOW RX TX AVG_QLEN AVG_PKTSIZE AVG_CHAINSIZE flow1 0.0% 0.0% 0.0 0.0 0.0 # flowstat show -g -k -i 30 flow: flow1 %rx packets 0 Scheduling: % packets polled 0 min_qlen 0 max_qlen 0 avg_qlen 0 min_pktsize 0 max_pktsize 0 avg_pktsize 0 min_chainsize 0 max_chainsize 0 avg_chainsize 0 flow: flow2 %rx packets 0 Scheduling: . . . . . . Example 9 Show historical network usage FLow usage statistics can be stored using the extended accounting facility, acctadm(1m). # acctadm -e extended -f /var/log/net.log net # acctadm net Network accounting: active Network accounting file: /var/log/net.log Tracked Network resources: extended Untracked Network resources: none The saved historical data can be retrieved in summary form using: # flowstat show-history -f /var/log/net.log LINK DURATION IPACKETS RBYTES OPACKETS OBYTES BANDWIDTH flowtcp 100 1031 546908 0 0 43.76Kbps e1000g0 0 0 0 0 0 0.00Mbps Display logging information for flowtcp starting at 02/19/2008, 10:38:46 and ending at 02/19/2008, 10:40:06: # flowstat show-history -s 02/19/2008,10:39:06 -e 02/19/2008,10:40:06 \ -f /var/log/net.log flowtcp FLOW START END RBYTES OBYTES BANDWIDTH flowtcp 10:39:06 10:39:26 1546 6539 3.23 Kbps flowtcp 10:39:26 10:39:46 3586 9922 5.40 Kbps flowtcp 10:39:46 10:40:06 240 216 182.40 bps flowtcp 10:40:06 10:40:26 0 0 0.00 bps Output the same information as above as a plotfile: # flowstat show-history -s 02/19/2008,10:39:06 -e 02/19/2008,10:40:06 \ -F gnuplot -f /var/log/net.log flowtcp # Time tcp-flow 10:39:06 3.23 10:39:26 5.40 10:39:46 0.18 10:40:06 0.00 EXIT STATUS 0 All actions were performed successfully. >0 An error occurred. ATTRIBUTES See attributes(5) for descriptions of the following attri- butes: /usr/sbin ____________________________________________________________ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | |_____________________________|_____________________________| | Availability | SUNWcsu | |_____________________________|_____________________________| | Interface Stability | Committed | |_____________________________|_____________________________| SEE ALSO acctadm(1M), dladm(1M), dlstat(1M), flowadm(1M), ifconfig(1M), prstat(1M), route(1M), attributes(5), dlpi(7P).