'\" te .\" Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. .TH flowstat 1M "13 Jul 2011" "SunOS 5.11" "System Administration Commands" .SH NAME flowstat \- report flow statistics .SH SYNOPSIS .LP .nf \fBflowstat\fR [\fB-r\fR | \fB-t\fR] [\fB-i\fR \fIinterval\fR] [\fB-l\fR \fIlink\fR] [\fB-T d|u\fR] [\fIflow\fR] [\fIinterval\fR [\fIcount\fR]] .fi .LP .nf \fBflowstat\fR [\fB-S\fR] [\fB-A\fR] [\fB-i\fR \fIinterval\fR] [\fB-p\fR] [ \fB-o\fR \fIfield\fR[,...]] [\fB-u\fR R|K|M|G|T|P] [\fIlink\fR] [\fB-l\fR \fIlink\fR] [\fB-T d|u\fR] [\fIflow\fR] [\fIinterval\fR [\fIcount\fR]] .fi .LP .nf \fBflowstat\fR \fB-h\fR [\fB-a\fR] \fB-f\fR \fIfilename\fR [\fB-d\fR] [\fB-F\fR \fIformat\fR] [\fB-s\fR \fItime\fR] [\fB-e\fR time] [\fIflow\fR] .fi .SH DESCRIPTION .sp .LP The \fBflowstat\fR command reports run time statistics about user defined flows. \fBflowadm show-flow\fR provides the flow name information for this command. .SH OPTIONS .sp .LP The \fBflowstat\fR command has the following options and operands that are common among a number of command forms shown under "Subcommands," below. .SH SUB-COMMANDS .sp .LP \fBflowstat\fR supports the following command forms. .sp .ne 2 .mk .na \fB\fBflowstat\fR [\fB-r\fR | \fB-t\fR] [\fB-l\fR \fIlink\fR] [\fB-T\fR \fBd\fR|\fBu\fR] [\fIflow\fR] [\fIinterval\fR [\fIcount\fR]]\fR .ad .sp .6 .RS 4n This form of the command 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. .sp .ne 2 .mk .na \fB\fB-r\fR\fR .ad .sp .6 .RS 4n Display receive-side statistics only. Includes bytes and packets received, drops, and so forth. See examples for complete listing. .RE .sp .ne 2 .mk .na \fB\fB-t\fR\fR .ad .sp .6 .RS 4n Display transmit-side statistics only. Includes bytes and packets sent, drops, and so forth. See examples below. .RE .sp .ne 2 .mk .na \fB\fB-i\fR \fIinterval\fR\fR .ad .sp .6 .RS 4n If specified, it denotes the interval at which output rows are refreshed. The first row of the output is the summary that shows the total numbers since the creation of the flow. The second row and beyond show the normalized (per second) statistics. If not specified, you obtain one summary since the creation of the specified flow. This option is obsolete. Interval instead (and count also if you want) must be supplied as operand at the end of the command. Also, you cannot supply interval at both option and operand. Doing so will result in error. .RE .sp .ne 2 .mk .na \fB\fB-l\fR \fIlink\fR | \fIflow\fR]\fR .ad .sp .6 .RS 4n Display statistics for all flows on the specified link or statistics for the specified flow. .RE .sp .ne 2 .mk .na \fB\fB-T\fR \fBu\fR|\fBd\fR\fR .ad .sp .6 .RS 4n Specify \fBu\fR for a printed representation of the internal representation of time. See \fBtime\fR(2). Specify \fBd\fR for standard date format. See \fBdate\fR(1). .RE .RE .sp .ne 2 .mk .na \fB\fBflowstat\fR [\fB-S\fR] [\fB-A\fR] [\fB-i\fR \fIinterval\fR] [\fB-p\fR] [ \fB-o\fR \fIfield\fR[,...]] [\fB-u\fR \fBR\fR|\fBK\fR|\fBM\fR|\fBG\fR|\fBT\fR|\fBP\fR] [\fB-l\fR \fIlink\fR] [\fB-T\fR \fBd\fR|\fBu\fR] [\fIflow\fR] [\fIinterval\fR [\fIcount\fR]]\fR .ad .sp .6 .RS 4n This form of the command allows you to specify which statistics to display. .sp .ne 2 .mk .na \fB\fB-A\fR\fR .ad .sp .6 .RS 4n Dump all statistics fields for this flow. Output statistics of this command are inclusive of all the statistics reported by all other \fBflowstat\fR commands. .RE .sp .ne 2 .mk .na \fB{\fB-l\fR \fIlink\fR} | \fIflow\fR\fR .ad .sp .6 .RS 4n Display statistics for all flows on the specified link or for the specified flow. .RE .sp .ne 2 .mk .na \fB\fB-o\fR \fIfield\fR[,...]\fR .ad .sp .6 .RS 4n Display 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 \fBall\fR to display all supported fields. .sp List of supported RX fields: .RS +4 .TP .ie t \(bu .el o \fBflow\fR .RE .RS +4 .TP .ie t \(bu .el o \fBrbytes\fR .RE .RS +4 .TP .ie t \(bu .el o \fBipkts\fR .RE .RS +4 .TP .ie t \(bu .el o \fBidrops\fR .RE List of TX fields: .RS +4 .TP .ie t \(bu .el o \fBflow\fR .RE .RS +4 .TP .ie t \(bu .el o \fBobytes\fR .RE .RS +4 .TP .ie t \(bu .el o \fBopkts\fR .RE .RS +4 .TP .ie t \(bu .el o \fBodrops\fR .RE .RE .sp .ne 2 .mk .na \fB\fB-p\fR\fR .ad .sp .6 .RS 4n Display output in a stable, machine-parseable format. .RE .sp .ne 2 .mk .na \fB\fB-S\fR\fR .ad .sp .6 .RS 4n Continuously display network utilization by flow in a manner similar to the way that \fBprstat\fR(1M) displays CPU utilization by process. .RE .sp .ne 2 .mk .na \fB\fB-u\fR \fBR\fR|\fBK\fR|\fBM\fR|\fBG\fR|\fBT\fR|\fBP\fR\fR .ad .sp .6 .RS 4n If used, allows choosing the unit in which to display all statistics, for example, \fBR\fR: Raw Numbers, \fBK\fR:Kilobits, \fBM\fR:Megabits, \fBT\fR:Terabits, \fBP\fR:Petabits. If not used, then different units, as appropriate, are used to display the statistics. .RE .RE .sp .ne 2 .mk .na \fB\fBflowstat\fR \fB-h\fR [\fB-a\fR] \fB-f\fR \fIfilename\fR [\fB-d\fR] [\fB-F\fR \fIformat\fR] [\fB-s\fR \fItime\fR] [\fB-e\fR \fItime\fR] [\fIflow\fR]\fR .ad .sp .6 .RS 4n Show the network usage history from a stored extended accounting file. Use of this syntax requires that net accounting has been previously configured and enabled by using \fBacctadm\fR(1M). The default output is the summary of network usage of the existing links for the entire period when extended accounting was enabled. .sp .ne 2 .mk .na \fB\fB-a\fR\fR .ad .sp .6 .RS 4n Display all historical network usage for the specified period when extended accounting is enabled. This includes usage information for the flows that have already been deleted. .RE .sp .ne 2 .mk .na \fB\fB-f\fR \fIfilename\fR\fR .ad .sp .6 .RS 4n Specify the file from which extended accounting records of network flow usage history are read. .RE .sp .ne 2 .mk .na \fB\fB-d\fR\fR .ad .sp .6 .RS 4n Display the dates for which there is logging information. The date is in the format \fImm\fR/\fIdd\fR/\fIyyyy\fR. .RE .sp .ne 2 .mk .na \fB\fB-F\fR \fIformat\fR\fR .ad .sp .6 .RS 4n Specify the output format of the network flow usage history information. \fBgnuplot\fR is the only supported format. .RE .sp .ne 2 .mk .na \fB\fB-s\fR \fItime\fR\fR .ad .br .na \fB\fB-e\fR \fItime\fR\fR .ad .sp .6 .RS 4n Specify start and stop times for data display. Time is in the format \fIMM\fR/\fIDD\fR/\fIYYYY\fR,\fIhh\fR:\fImm\fR:\fIss\fR. \fIhh\fR uses 24-hour clock notation. .RE .RE .SH OPERANDS .sp .LP \fBflowstat\fR command forms have a single, optional operand. .sp .ne 2 .mk .na \fB\fIflow\fR\fR .ad .sp .6 .RS 4n If specified, report only on the named flow. Otherwise, report on all flows. A flow has a name of the form \fIzonename\fR/\fIflowname\fR. A \fIflowname\fR without a \fIzonename\fR modifier is understood to be in the global zone. .RE .sp .ne 2 .mk .na \fB\fBinterval\fR\fR .ad .sp .6 .RS 4n If specified, it denotes the interval at which output rows are refreshed. The first row of the output is the summary that shows the total numbers since the creation of the flow. The second row and beyond show the normalized (per second) statistics. If not specified, you obtain one summary since the creation of the specified flow. .RE .sp .ne 2 .mk .na \fB\fBcount\fR\fR .ad .sp .6 .RS 4n If specified, only print 'count' rows. If not specified, print indefinitely. .RE .SH EXAMPLES .LP \fBExample 1 \fRDisplaying Statistics .sp .LP To display statistics for all the flows, enter following command. Statistics are displayed as 3-digit numbers with the appropriate unit. Default interval is one second. .sp .in +2 .nf # \fBflowstat -i 1\fR FLOW IPKTS RBYTES IDROPS OPKTS OBYTES ODROPS flow1 528.54K 787.39M 0 179.39K 11.85M 0 flow2 742.81K 1.10G 0 0 0 0 flow3 0 0 0 0 0 0 flow1 67.73K 101.02M 0 21.04K 1.39M 0 flow2 0 0 0 0 0 0 flow3 0 0 0 0 0 0 . . . . . . . . . . . . . . . . . . .fi .in -2 .sp .LP \fBExample 2 \fRDisplaying RX-Side Statistics .sp .LP The following command displays receive-side statistics .sp .in +2 .nf # \fBflowstat -r\fR FLOW IPKTS RBYTES IDROPS flow1 4.01M 5.98G 0 flow2 742.81K 1.10G 0 flow3 0 0 0 .fi .in -2 .sp .LP \fBExample 3 \fRDisplaying TX-Side Statistics .sp .LP The following command displays transmit-side statistics at a five-second interval. .sp .in +2 .nf # \fBflowstat -t\fR FLOW OPKTS OBYTES ODROPS flow1 24.37M 1.61G 0 flow2 0 0 0 flow3 4 216 0 .fi .in -2 .sp .LP \fBExample 4 \fRDisplaying Particular Set of Statistics .sp .LP The following command displays a specified set of statistics fields. .sp .in +2 .nf # \fBflowstat -o FLOW,IPKTS\fR FLOW IPKTS flow1 68.58M flow2 742.81K flow3 4 .fi .in -2 .sp .LP \fBExample 5 \fRShow Historical Network Usage .sp .LP Flow usage statistics can be stored by using the extended accounting facility, \fBacctadm\fR(1M). .sp .in +2 .nf # \fBacctadm -e extended -f /var/log/net.log net\fR # \fBacctadm net\fR Network accounting: active Network accounting file: /var/log/net.log Tracked Network resources: extended Untracked Network resources: none .fi .in -2 .sp .sp .LP The saved historical data can be retrieved as follows: .sp .in +2 .nf # \fBflowstat -h -f /var/log/net.log\fR LINK DURATION IPACKETS RBYTES OPACKETS OBYTES BANDWIDTH flowtcp 100 1031 546908 0 0 43.76Kbps flowudp 0 0 0 0 0 0.00Mbps .fi .in -2 .sp .sp .LP Display logging information for \fBflowtcp\fR starting at February 19, 2008 at 10:38:46 and ending on the same day at 10:40:06: .sp .in +2 .nf # \fBflowstat -h -s 02/19/2008,10:39:06 -e 02/19/2008,10:40:06 \e\fR \fB-f /var/log/net.log flowtcp\fR 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 .fi .in -2 .sp .sp .LP Generate the same output information as above as a plotfile: .sp .in +2 .nf # \fBflowstat -h -s 02/19/2008,10:39:06 -e 02/19/2008,10:40:06 \e\fR \fB-F gnuplot -f /var/log/net.log flowtcp\fR # \fBTime tcp-flow\fR 10:39:06 3.23 10:39:26 5.40 10:39:46 0.18 10:40:06 0.00 .fi .in -2 .sp .SH EXIT STATUS .sp .ne 2 .mk .na \fB\fB0\fR\fR .ad .sp .6 .RS 4n All actions were performed successfully. .RE .sp .ne 2 .mk .na \fB\fB>0\fR\fR .ad .sp .6 .RS 4n An error occurred. .RE .SH ATTRIBUTES .sp .LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp .LP \fB/usr/sbin\fR .sp .sp .TS tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPEATTRIBUTE VALUE _ Availabilitysystem/core-os _ Interface StabilitySee below .TE .sp .LP Screen output is Uncommitted. The invocation is Committed. .SH SEE ALSO .sp .LP \fBacctadm\fR(1M), \fBdladm\fR(1M), \fBdlstat\fR(1M), \fBflowadm\fR(1M), \fBifconfig\fR(1M), \fBprstat\fR(1M), \fBroute\fR(1M), \fBattributes\fR(5), \fBdlpi\fR(7P)