System Administration Commands flowstat(1M) NAME flowstat - report flow statistics SYNOPSIS flowstat [-r | -t] [-i interval] [-l link] [flow] flowstat [-i interval] [-p] [ -o field[,...]] [-u b|B|K|M|G|T|P] [-l link] [flow] flowstat -h [-a] -f filename [-d] [-F format] [-s time] [-e time] [flow] DESCRIPTION The flowstat command reports run time statistics about user defined flows. flowadm show-flow lists the flow names input to this command. flowstat [-r | -t] [-i interval] [-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. -r Display receive side statistics only. Includes bytes and packets received, drops etc. See examples for complete listing. -t Display transmit side statistics only. Includes bytes and packets sent, drops etc. See examples below. -i interval Used to specify an interval, in seconds, at which statistics would be refreshed. Default interval is one second. -l link | flow Display stats for all flows on the named link or stats for the named flow. flowstat [-i interval] [-p] [ -o field[,...]] [-u b|B|K|M|G|T|P] [-l link] [flow] Supports choosing specific statistics to display. -i interval Used to specify an interval, in seconds, at which statistics would be refreshed. Default interval is one second. -p Display using a stable machine-parseable format. -o field[,...] A case-insensitive, comma-separated list of output fields to display. The field name must be one of the fields listed below, or the special value all to display all supported fields. List of supported rx fields: flow link ibytes ipkts intrs polls List of tx side fields: flow link obytes opackets oerrors -u b|B|K|M|G|T|P Without this option, stats are outputted in format xy.zU where x, y, z are numbers while U is appropriate unit. -u lets us choose unit viz. b:bits, B:bytes, K:Kilobits, M:Megabits,... etc. -l link | flow Display stats for all flows on the named link or stats for the named flow. flowstat -h [-a] -f filename [-d] [-F format] [-s time] [-e time] [flow] Show the network 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 network flow usage history 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 network flow usage history 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. "hh" is using 24-hour clock notation. flow If specified, display the historical network usage only for the named flow. Otherwise, display historical network usage for all flows. EXAMPLES Example 1 Display statistics To display statistics for all the flows, enter following command. Statistics are displayed as 3 digit numbers with appropriate unit. Default interval is one second. # flowstat 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 nxge0 0.0M 0.0M 0.0M 0.0% 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 nxge0 0.0M 0.0M 0.0M 0.0M 0.0% . . . . . . . . . . . . . . . . . . . . . Example 2 Display rx side statistics # flowstat -r FLOW LINK IPKTS IBYTES DRPS flow1 nxge0 21.2K 2.1M 0.0 flow2 nxge0 24.5M 13.6G 0.0 flow3 nxge0 24.5M 13.6G 0.0 Example 3 Display tx side statistics To display Tx side statistics after every 5 seconds: # flowstat -t -i 5 FLOW LINK OBYTES OPKTS DRPS flow1 nxge0 0.0 0.0 0.0 flow2 nxge0 0.0 0.0 0.0 flow3 nxge0 0.0 0.0 0.0 FLOW LINK OBYTES OPKTS DRPS flow1 nxge0 0.0 0.0 0.0 flow2 nxge0 0.0 0.0 0.0 flow3 nxge0 0.0 0.0 0.0 FLOW LINK OBYTES OPKTS DRPS flow1 nxge0 0.0 0.0 0.0 . . . . . Example 4 Choosing to display statistics of interest Following command will display a group of statistics fields. # flowstat -o FLOW,LINK,IPKTS FLOW LINK IPKTS flow1 bge0 21.2K flow2 nxge0 24.5M flow3 nxge0 0.0M Example 5 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 -h -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 -h -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 -h -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 | See below. | |_____________________________|_____________________________| Screen output is Uncommited. The invocation is Committed. SEE ALSO acctadm(1M), dladm(1M), dlstat(1M), flowadm(1M), ifconfig(1M), prstat(1M), route(1M), attributes(5), dlpi(7P).