Annotation of src/usr.bin/systat/systat.1, Revision 1.29
1.29 ! jmc 1: .\" $OpenBSD: systat.1,v 1.28 2003/06/03 02:56:17 millert Exp $
1.2 deraadt 2: .\" $NetBSD: systat.1,v 1.6 1996/05/10 23:16:39 thorpej Exp $
1.1 deraadt 3: .\"
4: .\" Copyright (c) 1985, 1990, 1993
5: .\" The Regents of the University of California. All rights reserved.
6: .\"
7: .\" Redistribution and use in source and binary forms, with or without
8: .\" modification, are permitted provided that the following conditions
9: .\" are met:
10: .\" 1. Redistributions of source code must retain the above copyright
11: .\" notice, this list of conditions and the following disclaimer.
12: .\" 2. Redistributions in binary form must reproduce the above copyright
13: .\" notice, this list of conditions and the following disclaimer in the
14: .\" documentation and/or other materials provided with the distribution.
1.28 millert 15: .\" 3. Neither the name of the University nor the names of its contributors
1.1 deraadt 16: .\" may be used to endorse or promote products derived from this software
17: .\" without specific prior written permission.
18: .\"
19: .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20: .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21: .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22: .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23: .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24: .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25: .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26: .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27: .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28: .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29: .\" SUCH DAMAGE.
30: .\"
31: .\" @(#)systat.1 8.2 (Berkeley) 12/30/93
32: .\"
33: .Dd December 30, 1993
34: .Dt SYSTAT 1
1.12 aaron 35: .Os
1.1 deraadt 36: .Sh NAME
37: .Nm systat
38: .Nd display system statistics on a crt
39: .Sh SYNOPSIS
40: .Nm systat
1.2 deraadt 41: .Op Fl w Ar wait
42: .Op Ar display
1.1 deraadt 43: .Op Ar refresh-interval
44: .Sh DESCRIPTION
1.13 aaron 45: .Nm
1.1 deraadt 46: displays various system statistics in a screen oriented fashion
47: using the curses screen display library,
48: .Xr curses 3 .
49: .Pp
50: While
1.13 aaron 51: .Nm
1.1 deraadt 52: is running the screen is usually divided into two windows (an exception
1.16 aaron 53: is the vmstat display which uses the entire screen).
54: The upper window depicts the current system load average.
55: The information displayed in the lower window may vary, depending on
56: user commands.
57: The last line on the screen is reserved for user
1.1 deraadt 58: input and error messages.
59: .Pp
60: By default
1.13 aaron 61: .Nm
1.1 deraadt 62: displays the processes getting the largest percentage of the processor
1.16 aaron 63: in the lower window.
64: Other displays show swap space usage, disk
1.1 deraadt 65: .Tn I/O
66: statistics (a la
1.13 aaron 67: .Xr iostat 8 ) ,
1.1 deraadt 68: virtual memory statistics (a la
1.13 aaron 69: .Xr vmstat 8 ) ,
70: network
71: .Dq mbuf
72: utilization, and network connections (a la
73: .Xr netstat 1 ) .
1.1 deraadt 74: .Pp
75: Input is interpreted at two different levels.
1.13 aaron 76: A
77: .Dq global
78: command interpreter processes all keyboard input.
1.1 deraadt 79: If this command interpreter fails to recognize a command, the
1.16 aaron 80: input line is passed to a per-display command interpreter.
81: This allows each display to have certain display-specific commands.
1.1 deraadt 82: .Pp
1.16 aaron 83: The options are as follows:
1.19 aaron 84: .Bl -tag -width Ds
1.2 deraadt 85: .It Ar display
1.1 deraadt 86: The
87: .Ar display
1.2 deraadt 88: argument expects to be one of:
1.1 deraadt 89: .Ic pigs ,
90: .Ic iostat ,
91: .Ic swap ,
92: .Ic mbufs ,
93: .Ic vmstat
94: or
95: .Ic netstat .
1.2 deraadt 96: These displays can also be requested interactively and are described in
1.1 deraadt 97: full detail below.
98: .It Ar refresh-interval
99: The
1.2 deraadt 100: .Ar refresh-interval
1.16 aaron 101: specifies the screen refresh time interval in seconds.
102: This is provided for backwards compatibility, and overrides the
1.2 deraadt 103: .Ar refresh-interval
104: specified with the
105: .Fl w
106: flag.
1.1 deraadt 107: .El
108: .Pp
109: Certain characters cause immediate action by
1.13 aaron 110: .Nm systat .
1.1 deraadt 111: These are
112: .Bl -tag -width Fl
113: .It Ic \&^L
114: Refresh the screen.
115: .It Ic \&^G
1.13 aaron 116: Print the name of the current
117: .Dq display
118: being shown in
1.1 deraadt 119: the lower window and the refresh interval.
120: .It Ic \&^Z
1.27 jmc 121: Suspend
1.13 aaron 122: .Nm systat .
1.1 deraadt 123: .It Ic \&:
124: Move the cursor to the command line and interpret the input
1.16 aaron 125: line typed as a command.
126: While entering a command the
1.1 deraadt 127: current character erase, word erase, and line kill characters
128: may be used.
129: .El
130: .Pp
1.13 aaron 131: The following commands are interpreted by the
132: .Dq global
1.1 deraadt 133: command interpreter.
134: .Bl -tag -width Fl
135: .It Ic help
136: Print the names of the available displays on the command line.
137: .It Ic load
138: Print the load average over the past 1, 5, and 15 minutes
139: on the command line.
140: .It Ic stop
141: Stop refreshing the screen.
142: .It Xo
143: .Op Ic start
144: .Op Ar number
145: .Xc
1.16 aaron 146: Start (continue) refreshing the screen.
147: If a second, numeric,
1.1 deraadt 148: argument is provided it is interpreted as a refresh interval
149: (in seconds).
150: Supplying only a number will set the refresh interval to this
151: value.
152: .It Ic quit
153: Exit
1.13 aaron 154: .Nm systat .
1.1 deraadt 155: (This may be abbreviated to
1.13 aaron 156: .Ic q . )
1.1 deraadt 157: .El
158: .Pp
159: The available displays are:
160: .Bl -tag -width Ic
161: .It Ic pigs
162: Display, in the lower window, those processes resident in main
163: memory and getting the
164: largest portion of the processor (the default display).
165: When less than 100% of the
166: processor is scheduled to user processes, the remaining time
1.13 aaron 167: is accounted to the
168: .Dq idle
169: process.
1.1 deraadt 170: .It Ic iostat
171: Display, in the lower window, statistics about processor use
1.16 aaron 172: and disk throughput.
173: Statistics on processor use appear as
174: bar graphs of the amount of time executing in user mode
175: .Pq Dq user ,
176: in user mode running low priority processes
177: .Pq Dq nice ,
178: in system mode
179: .Pq Dq system ,
180: and idle
181: .Pq Dq idle .
182: Statistics
1.1 deraadt 183: on disk throughput show, for each drive, kilobytes of data transferred,
1.2 deraadt 184: number of disk transactions performed, and time spent in disk accesses
1.16 aaron 185: (in milliseconds).
186: This information may be displayed as
187: bar graphs or as rows of numbers which scroll downward.
188: Bar graphs are shown by default.
1.1 deraadt 189: .Pp
190: The following commands are specific to the
191: .Ic iostat
192: display; the minimum unambiguous prefix may be supplied.
193: .Pp
194: .Bl -tag -width Fl -compact
195: .It Cm numbers
196: Show the disk
1.12 aaron 197: .Tn I/O
1.16 aaron 198: statistics in numeric form.
199: Values are displayed in numeric columns which scroll downward.
1.1 deraadt 200: .It Cm bars
201: Show the disk
202: .Tn I/O
203: statistics in bar graph form (default).
1.2 deraadt 204: .It Cm secs
205: Toggle the display of time in disk activity (the default is to
206: not display time).
1.1 deraadt 207: .El
208: .It Ic swap
1.12 aaron 209: Show information about swap space usage on all the
1.1 deraadt 210: swap areas compiled into the kernel.
211: The first column is the device name of the partition.
212: The next column is the total space available in the partition.
1.12 aaron 213: The
1.1 deraadt 214: .Ar Used
215: column indicates the total blocks used so far;
216: the graph shows the percentage of space in use on each partition.
1.8 aaron 217: If there is more than one swap partition in use,
1.1 deraadt 218: a total line is also shown.
1.8 aaron 219: Areas known to the kernel but not in use are shown as not available.
1.1 deraadt 220: .It Ic mbufs
221: Display, in the lower window, the number of mbufs allocated
1.16 aaron 222: for particular uses, i.e., data, socket structures, etc.
1.1 deraadt 223: .It Ic vmstat
224: Take over the entire display and show a (rather crowded) compendium
225: of statistics related to virtual memory usage, process scheduling,
1.14 alex 226: device interrupts, system name translation caching, disk
1.1 deraadt 227: .Tn I/O
228: etc.
229: .Pp
230: The upper left quadrant of the screen shows the number
1.8 aaron 231: of users logged in and the load average over the last 1, 5,
232: and 15 minute intervals.
1.1 deraadt 233: Below this line are statistics on memory utilization.
234: The first row of the table reports memory usage only among
1.8 aaron 235: active processes, that is, processes that have run in the previous
1.1 deraadt 236: twenty seconds.
237: The second row reports on memory usage of all processes.
238: The first column reports on the number of physical pages
239: claimed by processes.
1.29 ! jmc 240: The second column reports the same figure for
1.8 aaron 241: virtual pages, that is, the number of pages that would be
1.1 deraadt 242: needed if all processes had all of their pages.
1.8 aaron 243: Finally, the last column shows the number of physical pages
1.1 deraadt 244: on the free list.
245: .Pp
1.5 flipk 246: Below the memory display is a list of the average number of processes
1.13 aaron 247: (over the last refresh interval) that are runnable
248: .Pq Sq r ,
249: in disk wait other than paging
250: .Pq Sq d ,
251: sleeping
252: .Pq Sq s ,
253: and swapped out but desiring to run
254: .Pq Sq w .
1.1 deraadt 255: Below the queue length listing is a numerical listing and
256: a bar graph showing the amount of
1.16 aaron 257: system (shown as
258: .Ql = ) ,
259: user (shown as
260: .Ql > ) ,
261: nice (shown as
262: .Ql - ) ,
263: and idle time (shown as
1.29 ! jmc 264: .Ql \ \& ) .
1.1 deraadt 265: .Pp
1.12 aaron 266: To the right of the Proc display are statistics about
1.16 aaron 267: Context switches
268: .Pq Dq Csw ,
269: Traps
270: .Pq Dq Trp ,
271: Syscalls
272: .Pq Dq Sys ,
273: Interrupts
274: .Pq Dq Int ,
275: Soft interrupts
276: .Pq Dq Sof ,
277: and Faults
278: .Pq Dq Flt
1.7 deraadt 279: which have occurred during the last refresh interval.
1.5 flipk 280: .Pp
281: Below the CPU Usage graph are statistics on name translations.
1.1 deraadt 282: It lists the number of names translated in the previous interval,
283: the number and percentage of the translations that were
284: handled by the system wide name translation cache, and
285: the number and percentage of the translations that were
286: handled by the per process name translation cache.
287: .Pp
1.5 flipk 288: At the bottom left is the disk usage display.
289: It reports the number of seeks, transfers, number
290: of kilobyte blocks transferred per second averaged over the
291: refresh period of the display (by default, five seconds), and
292: the time spent in disk accesses.
293: .Pp
1.1 deraadt 294: Under the date in the upper right hand quadrant are statistics
295: on paging and swapping activity.
296: The first two columns report the average number of pages
297: brought in and out per second over the last refresh interval
298: due to page faults and the paging daemon.
299: The third and fourth columns report the average number of pages
300: brought in and out per second over the last refresh interval
301: due to swap requests initiated by the scheduler.
302: The first row of the display shows the average
1.8 aaron 303: number of disk transfers per second over the last refresh interval.
304: The second row of the display shows the average
1.1 deraadt 305: number of pages transferred per second over the last refresh interval.
306: .Pp
307: Running down the right hand side of the display is a breakdown
308: of the interrupts being handled by the system.
309: At the top of the list is the total interrupts per second
310: over the time interval.
311: The rest of the column breaks down the total on a device
312: by device basis.
313: Only devices that have interrupted at least once since boot time are shown.
1.5 flipk 314: .Pp
315: Below the SWAPPING display and slightly to the left of the Interrupts
1.18 aaron 316: display is a list of virtual memory statistics.
317: The abbreviations are:
1.5 flipk 318: .Bl -tag -compact -width XXXXXX -offset indent
1.21 deraadt 319: .It forks
320: process forks
321: .It fkppw
322: forks where parent waits
323: .It fksvm
324: forks where vmspace is shared
325: .It pwait
326: fault had to wait on a page
327: .It relck
328: fault relock called
329: .It rlkok
330: fault relock is successful
331: .It noram
332: faults out of ram
333: .It ndcpy
334: number of times fault clears "need copy"
335: .It fltcp
336: number of times fault promotes with copy
337: .It zfod
338: fault promotes with zerofill
1.5 flipk 339: .It cow
1.21 deraadt 340: number of times fault anon cow
341: .It fmin
342: min number of free pages
343: .It ftarg
344: target number of free pages
345: .It itarg
346: target number of inactive pages
347: .It wired
348: wired pages
1.25 deraadt 349: .It pdfre
1.21 deraadt 350: pages daemon freed since boot
351: .It pdscn
352: pages daemon scanned since boot
1.5 flipk 353: .El
354: .Pp
1.13 aaron 355: The
356: .Ql %zfod
357: value is more interesting when observed over a long
1.5 flipk 358: period, such as from boot time (see the
359: .Cm boot
360: option below).
1.1 deraadt 361: .Pp
362: The following commands are specific to the
363: .Ic vmstat
364: display; the minimum unambiguous prefix may be supplied.
365: .Pp
1.16 aaron 366: .Bl -tag -width Ds -compact
1.1 deraadt 367: .It Cm boot
368: Display cumulative statistics since the system was booted.
369: .It Cm run
370: Display statistics as a running total from the point this
371: command is given.
372: .It Cm time
373: Display statistics averaged over the refresh interval (the default).
374: .It Cm zero
375: Reset running statistics to zero.
376: .El
377: .It Ic netstat
1.16 aaron 378: Display, in the lower window, network connections.
379: By default, network servers awaiting requests are not displayed.
380: Each address
381: is displayed in the format
382: .Dq host.port ,
383: with each shown symbolically, when possible.
384: It is possible to have addresses displayed numerically,
1.1 deraadt 385: limit the display to a set of ports, hosts, and/or protocols
386: (the minimum unambiguous prefix may be supplied):
1.16 aaron 387: .Bl -tag -width Ar
1.1 deraadt 388: .It Cm all
389: Toggle the displaying of server processes awaiting requests (this
390: is the equivalent of the
391: .Fl a
392: flag to
1.13 aaron 393: .Xr netstat 1 ) .
1.1 deraadt 394: .It Cm numbers
395: Display network addresses numerically.
396: .It Cm names
397: Display network addresses symbolically.
1.16 aaron 398: .It Cm protocol
1.1 deraadt 399: Display only network connections using the indicated protocol
1.13 aaron 400: (currently either
401: .Dq tcp
402: or
403: .Dq udp ) .
1.1 deraadt 404: .It Cm ignore Op Ar items
405: Do not display information about connections associated with
1.16 aaron 406: the specified hosts or ports.
407: Hosts and ports may be specified
408: by name
409: .Pf ( Dq vangogh ,
410: .Dq ftp ) ,
411: or numerically.
412: Host addresses
413: use the Internet dot notation
414: .Pq Dq 128.32.0.9 .
415: Multiple items
1.1 deraadt 416: may be specified with a single command by separating them with
417: spaces.
418: .It Cm display Op Ar items
419: Display information about the connections associated with the
1.16 aaron 420: specified hosts or ports.
421: As for
1.13 aaron 422: .Ar ignore ,
1.8 aaron 423: .Ar items
1.1 deraadt 424: may be names or numbers.
425: .It Cm show Op Ar ports\&|hosts
426: Show, on the command line, the currently selected protocols,
1.16 aaron 427: hosts, and ports.
428: Hosts and ports which are being ignored are prefixed with a
429: .Ql ! .
430: If
1.1 deraadt 431: .Ar ports
432: or
433: .Ar hosts
434: is supplied as an argument to
1.13 aaron 435: .Cm show ,
1.1 deraadt 436: then only the requested information will be displayed.
437: .It Cm reset
438: Reset the port, host, and protocol matching mechanisms to the default
439: (any protocol, port, or host).
440: .El
441: .El
442: .Pp
443: Commands to switch between displays may be abbreviated to the
1.16 aaron 444: minimum unambiguous prefix; for example,
445: .Dq io
446: for
447: .Dq iostat .
1.1 deraadt 448: Certain information may be discarded when the screen size is
1.16 aaron 449: insufficient for display.
450: For example, on a machine with 10 drives the
1.1 deraadt 451: .Ic iostat
1.16 aaron 452: bar graph displays only 3 drives on a 24 line terminal.
453: When a bar graph would overflow the allotted screen space it is
454: truncated and the actual value is printed
455: .Dq over top
456: of the bar.
1.1 deraadt 457: .Pp
458: The following commands are common to each display which shows
1.16 aaron 459: information about disk drives.
460: These commands are used to
1.1 deraadt 461: select a set of drives to report on, should your system have
462: more drives configured than can normally be displayed on the
463: screen.
464: .Pp
465: .Bl -tag -width Tx -compact
466: .It Cm ignore Op Ar drives
1.16 aaron 467: Do not display information about the drives indicated.
468: Multiple drives may be specified, separated by spaces.
1.1 deraadt 469: .It Cm display Op Ar drives
1.16 aaron 470: Display information about the drives indicated.
471: Multiple drives may be specified, separated by spaces.
1.1 deraadt 472: .El
473: .Sh FILES
474: .Bl -tag -width /etc/networks -compact
475: .It Pa /etc/hosts
1.22 miod 476: host names
1.1 deraadt 477: .It Pa /etc/networks
1.22 miod 478: network names
1.1 deraadt 479: .It Pa /etc/services
1.22 miod 480: port names
1.1 deraadt 481: .El
1.15 aaron 482: .Sh SEE ALSO
483: .Xr kill 1 ,
484: .Xr ps 1 ,
485: .Xr top 1 ,
486: .Xr renice 8
1.1 deraadt 487: .Sh HISTORY
488: The
1.13 aaron 489: .Nm
1.1 deraadt 490: program appeared in
491: .Bx 4.3 .
492: .Sh BUGS
1.10 aaron 493: Takes 2-10 percent of the CPU.
1.1 deraadt 494: Certain displays presume a minimum of 80 characters per line.
495: The
496: .Ic vmstat
497: display looks out of place because it is (it was added in as
498: a separate display rather than created as a new program).