Table of ContentsView in Frames

Viewing or clearing network interface statistics

You can use the ifstat command to view the cumulative statistics of packets received and sent on a specified interface or on all interfaces. You can also use the ifstat command to clear the statistics.

About this task

Step

  1. Depending on the statistics that you want to view, perform the following step:
    If you want to... Enter the following command...
    View the network interface statistics of all interfaces
    ifstat -a
    View the network interface statistics of a specific interface
    ifstat interface_name

    interface_name is the name of the network interface.

    Clear the network interface statistics of a network interface
    ifstat -z interface_name

    The output of the ifstat command depends on the type of interface. For example, Ethernet or Gigabit Ethernet interfaces generate different types of statistics.

Example of showing the network interface statistics before and after clearing them

To view the statistics of the network interface e0a, enter the following command:

ifstat e0a

An output similar to the following is displayed.
system1> ifstat e0a

-- interface  e0a  (8 days, 20 hours, 10 minutes, 27 seconds) --

RECEIVE
 Frames/second:      13  | Bytes/second:      800  | Errors/minute:       0
 Discards/minute:     0  | Total frames:      897k | Total bytes:     62415k
 Total errors:        0  | Total discards:      0  | Multi/broadcast:   734k
 No buffers:          0  | Non-primary u/c:     0  | Tag drop:            0
 Vlan tag drop:       0  | Vlan untag drop:     0  | CRC errors:          0
 Runt frames:         0  | Fragment:            0  | Long frames:         0
 Jabber:              0  | Alignment errors:    0  | Bus overruns:        0
 Queue overflows:     0  | Xon:                 0  | Xoff:                0
 Jumbo:               0  | Reset:               0  | Reset1:              0
 Reset2:              0
TRANSMIT
 Frames/second:       2  | Bytes/second:      110  | Errors/minute:       0
 Discards/minute:     0  | Total frames:      153k | Total bytes:     24129k
 Total errors:        0  | Total discards:      0  | Multi/broadcast:  9478
 Queue overflows:     0  | No buffers:          0  | Max collisions:      0
 Single collision:    0  | Multi collisions:    0  | Late collisions:     0
 Timeout:             0  | Xon:                 0  | Xoff:                0
 Jumbo:               0
LINK_INFO
 Current state:       up | Up to downs:         0  | Auto:                on
 Speed:            1000m | Duplex:            full | Flowcontrol:       none

The following command clears and reinitializes the statistics for the network interface e0a:

ifstat -z e0a

The following sample output shows the network interface statistics for the network interface e0a immediately after the statistics are cleared:
system1> ifstat e0a

-- interface  e0a  (0 hours, 0 minutes, 8 seconds) --

RECEIVE
 Frames/second:       1  | Bytes/second:       32  | Errors/minute:       0
 Discards/minute:     0  | Total frames:        7  | Total bytes:       448
 Total errors:        0  | Total discards:      0  | Multi/broadcast:     0
 No buffers:          0  | Non-primary u/c:     0  | Tag drop:            0
 Vlan tag drop:       0  | Vlan untag drop:     0  | CRC errors:          0
 Runt frames:         0  | Fragment:            0  | Long frames:         0
 Jabber:              0  | Alignment errors:    0  | Bus overruns:        0
 Queue overflows:     0  | Xon:                 0  | Xoff:                0
 Jumbo:               0  | Reset:               0  | Reset1:              0
 Reset2:              0
TRANSMIT
 Frames/second:       1  | Bytes/second:       17  | Errors/minute:       0
 Discards/minute:     0  | Total frames:        4  | Total bytes:       361
 Total errors:        0  | Total discards:      0  | Multi/broadcast:     0
 Queue overflows:     0  | No buffers:          0  | Max collisions:      0
 Single collision:    0  | Multi collisions:    0  | Late collisions:     0
 Timeout:             0  | Xon:                 0  | Xoff:                0
 Jumbo:               0
LINK_INFO
 Current state:       up | Up to downs:         0  | Auto:                on
 Speed:            1000m | Duplex:            full | Flowcontrol:       none