ifstat(1M) — ADMINISTRATOR COMMANDS
NAME
ifstat − displays interface statistics
SYNOPSIS
ifstat [-adfstz] [-l interval] [ config_file [ cntrlr_num ] ]
DESCRIPTION
ifstat provides a common, configurable platform for the display of driver-specific interface statistics gathered by the supported drivers. ifstat displays statistics to stdout in the format dictated by the configuration file, config_file (see ifstat.conf(4)). The user may specify config_file on the command line, or let ifstat choose the configuration file. ifstat chooses a configuration file by requesting a list of supported interfaces from ip. ifstat picks the first interface for which a configuration file exists in the directory /etc/ifstat.conf. The caller may specify config_file as an absolute path or a relative path. If the path is relative (does not start with a "/"), ifstat looks for config_file relative to /etc/ifstat.conf. If not found, ifstat next looks for config_file relative to the current working directory. ifstat fails if it cannot find a valid configuration file.
If config_file is specified, the caller may also issue a controller number, cntrlr_num, on the command line. The controller number defaults to "0" if unspecified. The controller number is either appended to the special device file name found in config_file or ignored depending on the action specified in config_file (see ifstat.conf(4)). For instance, the config_file m376 tells ifstat to append the controller number to the device name. A user issuing the command ifstat m376 would, by default, get statistics from the MVME376 driver for controller 0. The command ifstat m376 1 would get statistics from controller 1.
The maximum length of the config_file parameter is 128 characters. The maximum length of the cntrlr_num parameter is 8 characters.
The caller may issue the following options on the ifstat command line:
-a All statistics. Display all possible statistics for the requested driver. ifstat simply looks for the all version of the config_file specified on the command line (or the config_file ifstat found if none specified). The resulting display typically exceeds the screen length, so this option should not normally be used with the -f option.
-d Difference counts. Display the differences between the current stats and the previous stats during each display iteration. This option is used in conjunction with -f. Certain tagged statistics in the config_file are unaffected by this option, i.e., they are not counters and therefore always show the same value.
-f Forever option. Cumulative statistics displayed every 5 seconds until the user sends an interrupt signal to the program. If the screen becomes garbled, the user may send a quit signal to the program, and ifstat will clear the screen on the next display iteration. See stty(1) for a discussion on setting the interrupt (intr) and quit (quit) control characters.
-s Show interfaces. Display the ip interfaces that ifstat supports. ifstat does not display interfaces not currently configured under ip. For example, for two MVME376 boards in a system, if only the first board is configured under ip, ifstat displays the first board and not the second. Examine the configuration files under /etc/ifstat.conf to learn all the possible interfaces ifstat can support.
-t Terminfo unsupported. Used with terminals that do not have terminfo(4) entries or do not support curses(3X) commands.
-z Zero statistics. Zeroes ifstat’s version of the statistics. When used with the -f option, causes cumulative statistics to begin at 0. Certain tagged statistics in the config_file are unaffected by this option, i.e., they are not counters and therefore always show the same (non-zeroed) value. Note: This command does not actually zero the statistics kept in the driver, only the version ifstat keeps.
-l interval
Display interval. The number of seconds to wait before gathering and displaying another set of statistics. This option is useful only in conjunction with -f. ifstat treats this value as an unsigned integer.
ifstat prints a standard header before displaying any statistics. The header consists of the name of the device that ifstat is requesting statistics from followed by the current time. ifstat then prints a blank line followed by the actual statistics. A user should examine the MACIOC_GETSTATS ioctl description in a corresponding driver man page to ascertain the exact meaning of statistics displayed from its configuration file. A driver man page that does not describe the MACIOC_GETSTATS ioctl does not support ifstat. Not all of the drivers corresponding to the section 7 man pages in the SEE ALSO section support ifstat.
FILES
/etc/ifstat.conf/∗
SEE ALSO
stty(1), curses(3X), ifstat.conf(4), terminfo(4), dlce(7), e1x7(7), ip(7), lo(7), m376(7), m385(7), ppp(7), slip(7)
DIAGNOSTICS
ifstat displays the requested statistics, then exits with a 0 status. If ifstat does not terminate normally, it displays an error message to stderr and returns a non-zero exit status as follows:
1Errors were found in the command line arguments
2config_file does not exist
3Failed to open the ip device to get interfaces
4SIOCGIFCONF (get interfaces) ioctl to ip failed
5No ifstat-supporting driver found via ip
6Failed to open config_file
7Device line format bad in config_file
8Action in device line of config_file bad
9Code format bad in config_file
10Failed to initialize terminal for curses
11Failed to open device specified in config_file
12MACIOC_GETSTATS (get statistics) ioctl to driver failed