Go to main content

Managing Network Virtualization and Network Resources in Oracle® Solaris 11.3

Exit Print View

Updated: April 2018
 
 

Displaying Historical Statistics on Network Traffic

After you have enabled network accounting, you can use the dlstat and flowstat commands to extract information from the log file.

You must enable extended accounting for the network before you can display historical data about the network. Further, to display historical data about traffic on flows, you must first configure flows on the system, as explained in Managing Network Resources by Using Flows.

Displaying Historical Network Traffic Statistics on Datalinks

You can display historical network traffic statistics on datalinks by using the following command syntax:

# dlstat show-link -h [-a] -f filename [-d date] [-F format] [-s start-time] [-e end-time] [link]
–h

Displays a summary of historical information about resource usage by incoming and outgoing packets on datalinks.

–a

Displays resource usage on all datalinks, including those that have already been deleted after the data capture.

–f filename

Specifies the log file that was defined when network accounting was enabled with the acctadm command.

–d date

Displays logged information for the specified date.

–F format

Displays the data in a specific format that can then be plotted for analysis. Currently, gnuplot is the only supported format.

–s start-time

Specifies the start time to display the logged information of the network statistics. Use the MM/DD/YYY,hh:mm:ss format. The hour (hh) must use 24-hour clock notation. If you do not include the date, then data for the specified time range for the current date is displayed.

–e end-time

Specifies the end time to display the logged information of the network statistics. Use the MM/DD/YYY,hh:mm:ss format. The hour (hh) must use 24-hour clock notation. If you do not include the date, then data for the specified time range for the current date is displayed.

link

Displays historical data for a specified datalink. If you do not use this option, then historical network data for all configured datalinks is displayed.

Example 100  Displaying Historical Statistics About Resource Usage on Datalinks

In this example, the historical statistics about network traffic and its use of resources on all the datalinks in a system are displayed.

# dlstat show-link -h -f /var/log/net.log
LINK  DURATION  IPKTS    RBYTES     OPKTS  OBYTES     BANDWIDTH
net0   80        1031    546908      0        0       2.44 Mbps
net1   100       2045    235977      0        0       9.67 Mbps

Displaying Historical Network Traffic Statistics on Flows

You can display historical network traffic statistics on flows by using the following command syntax:

# flowstat -h [-a] -f filename [-d date] [-F format] [-s start-time] [-e end-time] [flow]
–h

Displays a summary of historical information about resource usage by incoming and outgoing packets on configured flows.

–a

Displays resource usage on all configured flows, including those that have already been deleted after the data capture.

–f filename

Specifies the log file that was defined when network accounting was enabled with the acctadm command.

–d

Displays logged information for the specified date.

–F format

Displays the data in a specific format. Currently, gnuplot is the only supported format.

–s start-time

Specifies the start time to display the logged information of the network statistics. Use the MM/DD/YYY,hh:mm:ss format. The hour (hh) must use 24-hour clock notation. If you do not include the date, then data for the specified time range for the current date is displayed.

–e end-time

Specifies the end time to display the logged information of the network statistics. Use the MM/DD/YYY,hh:mm:ss format. The hour (hh) must use 24-hour clock notation. If you do not include the date, then data for the specified time range for the current date is displayed.

flow

Displays historical data for a specified flow. If you do not use this option, then historical network data for all configured flows is displayed.

Example 101  Displaying Historical Statistics About Resource Usage on Flows

The following example displays historical statistics of resource usage by traffic on the flows in a system.

# flowstat -h -f /var/log/net.log
FLOW      DURATION  IPACKETS RBYTES      OPACKETS OBYTES    BANDWIDTH
flowtcp   100       1031     546908      0        0         43.76Kbps
flowudp   0         0        0           0        0          0.00Mbps

The following example displays historical statistics of resource usage by traffic on flowtcp over a given date and time range.

# 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

The following example displays historical statistics of resource usage by traffic on flowtcp over a given date and time range by using gnuplot format.

# 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