Annotation of src/usr.bin/systat/systat.1, Revision 1.67
1.67 ! jmc 1: .\" $OpenBSD: systat.1,v 1.66 2008/11/01 00:38:43 canacar 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: .\"
1.67 ! jmc 33: .Dd $Mdocdate: November 1 2008 $
1.1 deraadt 34: .Dt SYSTAT 1
1.12 aaron 35: .Os
1.1 deraadt 36: .Sh NAME
37: .Nm systat
1.41 jmc 38: .Nd display system statistics
1.1 deraadt 39: .Sh SYNOPSIS
40: .Nm systat
1.62 matthieu 41: .Op Fl abin
42: .Op Fl d Ar count
43: .Op Fl s Ar delay
44: .Op Fl w Ar width
45: .Op Ar view
46: .Op Ar delay
1.1 deraadt 47: .Sh DESCRIPTION
1.13 aaron 48: .Nm
1.1 deraadt 49: displays various system statistics in a screen oriented fashion
50: using the curses screen display library,
51: .Xr curses 3 .
52: .Pp
53: While
1.13 aaron 54: .Nm
1.1 deraadt 55: is running the screen is usually divided into two windows (an exception
1.16 aaron 56: is the vmstat display which uses the entire screen).
57: The upper window depicts the current system load average.
58: The information displayed in the lower window may vary, depending on
59: user commands.
60: The last line on the screen is reserved for user
1.1 deraadt 61: input and error messages.
62: .Pp
63: By default
1.13 aaron 64: .Nm
1.1 deraadt 65: displays the processes getting the largest percentage of the processor
1.16 aaron 66: in the lower window.
1.60 jmc 67: Other displays include swap space usage, disk I/O
1.1 deraadt 68: statistics (a la
1.13 aaron 69: .Xr iostat 8 ) ,
1.1 deraadt 70: virtual memory statistics (a la
1.13 aaron 71: .Xr vmstat 8 ) ,
72: network
73: .Dq mbuf
74: utilization, and network connections (a la
75: .Xr netstat 1 ) .
1.1 deraadt 76: .Pp
77: Input is interpreted at two different levels.
1.13 aaron 78: A
79: .Dq global
80: command interpreter processes all keyboard input.
1.1 deraadt 81: If this command interpreter fails to recognize a command, the
1.16 aaron 82: input line is passed to a per-display command interpreter.
83: This allows each display to have certain display-specific commands.
1.1 deraadt 84: .Pp
1.16 aaron 85: The options are as follows:
1.62 matthieu 86: .Bl -tag -width Ds
1.64 jmc 87: .It Fl a
1.62 matthieu 88: Display all lines.
89: .It Fl b
1.64 jmc 90: Raw, non interactive mode.
1.62 matthieu 91: .It Fl d Ar count
92: Exit after
93: .Ar count
94: screen updates.
95: .It Fl i
96: Interactive mode.
1.34 itojun 97: .It Fl n
98: Do not try to reverse-map IP address.
1.62 matthieu 99: .It Fl s Ar delay
1.31 jmc 100: Specifies the screen refresh time interval in seconds.
1.62 matthieu 101: This option is overridden by the final
1.64 jmc 102: .Ar delay
1.62 matthieu 103: argument if given.
1.31 jmc 104: The default interval is 5 seconds.
1.62 matthieu 105: .It Fl w Ar width
1.63 sobrado 106: Specifies the maximum width of the display.
1.62 matthieu 107: .\" XXX not sure for the above.
108: .It Ar view
1.1 deraadt 109: The
1.62 matthieu 110: .Ar view
1.2 deraadt 111: argument expects to be one of:
1.62 matthieu 112: .Ic vmstat ,
1.1 deraadt 113: .Ic pigs ,
1.62 matthieu 114: .Ic ifstat ,
1.1 deraadt 115: .Ic iostat ,
1.49 deraadt 116: .Ic sensors ,
1.1 deraadt 117: .Ic mbufs ,
1.62 matthieu 118: .Ic netstat ,
119: .Ic swap ,
120: .Ic states ,
121: .Ic rules ,
122: .Ic queues
1.1 deraadt 123: or
1.62 matthieu 124: .Ic pf .
1.2 deraadt 125: These displays can also be requested interactively and are described in
1.1 deraadt 126: full detail below.
1.62 matthieu 127: .Ar view
1.53 jmc 128: may be abbreviated to the minimum unambiguous prefix;
129: for example,
1.50 jmc 130: .Dq io
131: for
132: .Dq iostat .
1.62 matthieu 133: .It Ar delay
1.1 deraadt 134: The
1.62 matthieu 135: .Ar delay
1.16 aaron 136: specifies the screen refresh time interval in seconds.
137: This is provided for backwards compatibility, and overrides the
1.31 jmc 138: .Ar wait
139: interval specified with the
1.2 deraadt 140: .Fl w
141: flag.
1.31 jmc 142: The default interval is 5 seconds.
1.1 deraadt 143: .El
144: .Pp
145: Certain characters cause immediate action by
1.61 jmc 146: .Nm .
1.63 sobrado 147: These are:
1.1 deraadt 148: .Bl -tag -width Fl
149: .It Ic \&:
150: Move the cursor to the command line and interpret the input
1.16 aaron 151: line typed as a command.
152: While entering a command the
1.1 deraadt 153: current character erase, word erase, and line kill characters
154: may be used.
1.66 canacar 155: .It Ic p
156: Pause
157: .Nm .
1.59 jmc 158: .It Ic q
159: Exit
1.66 canacar 160: .Nm .
161: .It Ic ^A \*(Ba Aq Ic Home
162: Jump to the beginning of the current view.
163: .It Ic ^B \*(Ba Aq Ic right arrow
164: Select previous view.
165: .It Ic ^E \*(Ba Aq Ic End
166: Jump to the end of the current view.
167: .It Ic ^F \*(Ba Aq Ic left arrow
168: Select the next view.
169: .It Ic ^G
170: Print the name of the current
171: .Dq display
172: being shown in
173: the lower window and the refresh interval.
174: .It Ic ^L
175: Refresh the screen.
176: .It Ic ^N \*(Ba Aq Ic down arrow
177: Scroll current view down by one line.
178: .It Ic ^P \*(Ba Aq Ic up arrow
179: Scroll current view up by one line.
180: .It Ic ^V \*(Ba Aq Ic Page Down
181: Scroll current view down by one page.
182: .It Ic Alt-V \*(Ba Aq Ic Page Up
183: Scroll current view up by one page.
184: .It Ic ^Z
185: Suspend
1.59 jmc 186: .Nm .
1.1 deraadt 187: .El
188: .Pp
1.13 aaron 189: The following commands are interpreted by the
190: .Dq global
1.1 deraadt 191: command interpreter.
192: .Bl -tag -width Fl
193: .It Ic help
194: Print the names of the available displays on the command line.
195: .It Ic load
196: Print the load average over the past 1, 5, and 15 minutes
197: on the command line.
1.52 jmc 198: .It Ic quit
199: Exit
1.61 jmc 200: .Nm .
1.52 jmc 201: (This may be abbreviated to
202: .Ic q . )
1.1 deraadt 203: .It Ic stop
204: Stop refreshing the screen.
205: .It Xo
206: .Op Ic start
207: .Op Ar number
208: .Xc
1.16 aaron 209: Start (continue) refreshing the screen.
210: If a second, numeric,
1.1 deraadt 211: argument is provided it is interpreted as a refresh interval
212: (in seconds).
213: Supplying only a number will set the refresh interval to this
214: value.
215: .El
216: .Pp
1.53 jmc 217: Again,
218: .Ar display
219: may be abbreviated to the minimum unambiguous prefix.
1.1 deraadt 220: The available displays are:
1.52 jmc 221: .Bl -tag -width "netstatXXX"
222: .It Ic ifstat
223: Display, in the lower window, interface statistics.
224: The
225: .Dq State
226: column has the format
227: .Sm off
228: .Xo
229: .Cm up \*(Ba dn
230: .Bq : Cm U \*(Ba D .
231: .Xc
232: .Sm on
233: .Sq up
234: and
235: .Sq dn
236: represent whether the interface is up or down.
237: .Sq U
238: and
239: .Sq D
240: represent whether the interface is connected or not;
241: in the case of
242: .Xr carp 4
243: interfaces, whether the interface is in master or backup state, respectively.
244: See below for more options.
245: .It Ic iostat
246: Display, in the lower window, statistics about disk throughput.
247: Statistics
248: on disk throughput show, for each drive, data transferred in kilobytes,
249: number of disk transactions performed, and time spent in disk accesses
1.56 otto 250: (in fractions of a second).
1.52 jmc 251: .It Ic mbufs
252: Display, in the lower window, the number of mbufs allocated
253: for particular uses, i.e., data, socket structures, etc.
254: .It Ic netstat
255: Display, in the lower window, network connections.
256: By default, network servers awaiting requests are not displayed.
257: Each address
258: is displayed in the format
259: .Dq host.port ,
260: with each shown symbolically, when possible.
261: It is possible to have addresses displayed numerically,
262: limit the display to a set of ports, hosts, and/or protocols
263: (the minimum unambiguous prefix may be supplied):
264: .Bl -tag -width Ar
265: .It Cm all
266: Toggle the displaying of server processes awaiting requests (this
267: is the equivalent of the
268: .Fl a
269: flag to
270: .Xr netstat 1 ) .
271: .It Cm display Op Ar items
272: Display information about the connections associated with the
273: specified hosts or ports.
274: As for
275: .Ar ignore ,
276: .Ar items
277: may be names or numbers.
278: .It Cm ignore Op Ar items
279: Do not display information about connections associated with
280: the specified hosts or ports.
281: Hosts and ports may be specified
282: by name
283: .Pf ( Dq vangogh ,
284: .Dq ftp ) ,
285: or numerically.
286: Host addresses
287: use the Internet dot notation
288: .Pq Dq 128.32.0.9 .
289: Multiple items
290: may be specified with a single command by separating them with
291: spaces.
292: .It Cm names
293: Display network addresses symbolically.
294: .It Cm numbers
295: Display network addresses numerically.
296: .It Cm reset
297: Reset the port, host, and protocol matching mechanisms to the default
298: (any protocol, port, or host).
1.63 sobrado 299: .It Cm show Oo
300: .Ar protocols \*(Ba ports \*(Ba hosts
301: .Oc
1.52 jmc 302: Show, on the command line, the currently selected protocols,
303: hosts, and ports.
1.55 moritz 304: Protocols, hosts and ports which are being ignored are prefixed with a
1.52 jmc 305: .Ql \&! .
1.55 moritz 306: If an argument is supplied to
1.52 jmc 307: .Cm show ,
308: then only the requested information will be displayed.
1.55 moritz 309: .It Cm tcp \*(Ba udp \*(Ba all
310: Display only network connections using the indicated protocol.
1.52 jmc 311: .El
1.62 matthieu 312: .It Ic pf
1.64 jmc 313: Display filter information about
1.62 matthieu 314: .Xr pf 4 ,
315: similar to the output of
1.64 jmc 316: .Cm pfctl Fl s Cm info
1.62 matthieu 317: option.
1.1 deraadt 318: .It Ic pigs
319: Display, in the lower window, those processes resident in main
320: memory and getting the
321: largest portion of the processor (the default display).
322: When less than 100% of the
323: processor is scheduled to user processes, the remaining time
1.13 aaron 324: is accounted to the
325: .Dq idle
326: process.
1.62 matthieu 327: .It Ic queues
1.64 jmc 328: Display statistics about the active
329: .Xr altq 9
330: queues, similar to the output of
1.62 matthieu 331: .Cm pfctl Fl s Cm queue .
332: .It Ic rules
1.64 jmc 333: Display pf rules statistics, similar to the output of
1.62 matthieu 334: .Cm pfctl Fl s Cm rules .
1.52 jmc 335: .It Ic sensors
336: Display, in the lower window,
337: the current values of available hardware sensors,
338: in a format similar to that of
339: .Xr sysctl 8 .
1.62 matthieu 340: .It Ic states
1.64 jmc 341: Display pf states statistics, similar to the output of
1.62 matthieu 342: .Cm pfctl Fl s Cm states .
1.1 deraadt 343: .It Ic swap
1.12 aaron 344: Show information about swap space usage on all the
1.1 deraadt 345: swap areas compiled into the kernel.
346: The first column is the device name of the partition.
347: The next column is the total space available in the partition.
1.12 aaron 348: The
1.1 deraadt 349: .Ar Used
350: column indicates the total blocks used so far;
351: the graph shows the percentage of space in use on each partition.
1.8 aaron 352: If there is more than one swap partition in use,
1.1 deraadt 353: a total line is also shown.
1.8 aaron 354: Areas known to the kernel but not in use are shown as not available.
1.1 deraadt 355: .It Ic vmstat
356: Take over the entire display and show a (rather crowded) compendium
357: of statistics related to virtual memory usage, process scheduling,
1.60 jmc 358: device interrupts, system name translation caching, disk I/O etc.
1.1 deraadt 359: .Pp
360: The upper left quadrant of the screen shows the number
1.8 aaron 361: of users logged in and the load average over the last 1, 5,
362: and 15 minute intervals.
1.1 deraadt 363: Below this line are statistics on memory utilization.
364: The first row of the table reports memory usage only among
1.8 aaron 365: active processes, that is, processes that have run in the previous
1.1 deraadt 366: twenty seconds.
367: The second row reports on memory usage of all processes.
1.47 millert 368: The first column reports on the amount of physical memory
1.1 deraadt 369: claimed by processes.
1.29 jmc 370: The second column reports the same figure for
1.47 millert 371: virtual memory, that is, the amount of memory that would be
372: needed if all processes were resident at the same time.
373: Finally, the last column shows the amount of physical memory
1.1 deraadt 374: on the free list.
375: .Pp
1.5 flipk 376: Below the memory display is a list of the average number of processes
1.13 aaron 377: (over the last refresh interval) that are runnable
378: .Pq Sq r ,
379: in disk wait other than paging
380: .Pq Sq d ,
381: sleeping
382: .Pq Sq s ,
383: and swapped out but desiring to run
384: .Pq Sq w .
1.1 deraadt 385: Below the queue length listing is a numerical listing and
386: a bar graph showing the amount of
1.40 dlg 387: interrupt (shown as
1.63 sobrado 388: .Ql \*(Ba ) ,
1.16 aaron 389: system (shown as
390: .Ql = ) ,
391: user (shown as
1.43 jmc 392: .Ql \*(Gt ) ,
1.16 aaron 393: nice (shown as
394: .Ql - ) ,
395: and idle time (shown as
1.29 jmc 396: .Ql \ \& ) .
1.1 deraadt 397: .Pp
1.12 aaron 398: To the right of the Proc display are statistics about
1.16 aaron 399: Context switches
400: .Pq Dq Csw ,
401: Traps
402: .Pq Dq Trp ,
403: Syscalls
404: .Pq Dq Sys ,
405: Interrupts
406: .Pq Dq Int ,
407: Soft interrupts
408: .Pq Dq Sof ,
409: and Faults
410: .Pq Dq Flt
1.7 deraadt 411: which have occurred during the last refresh interval.
1.5 flipk 412: .Pp
413: Below the CPU Usage graph are statistics on name translations.
1.1 deraadt 414: It lists the number of names translated in the previous interval,
415: the number and percentage of the translations that were
416: handled by the system wide name translation cache, and
417: the number and percentage of the translations that were
418: handled by the per process name translation cache.
419: .Pp
1.5 flipk 420: At the bottom left is the disk usage display.
421: It reports the number of seeks, transfers, number
422: of kilobyte blocks transferred per second averaged over the
423: refresh period of the display (by default, five seconds), and
424: the time spent in disk accesses.
425: .Pp
1.1 deraadt 426: Under the date in the upper right hand quadrant are statistics
427: on paging and swapping activity.
428: The first two columns report the average number of pages
429: brought in and out per second over the last refresh interval
430: due to page faults and the paging daemon.
431: The third and fourth columns report the average number of pages
432: brought in and out per second over the last refresh interval
433: due to swap requests initiated by the scheduler.
434: The first row of the display shows the average
1.8 aaron 435: number of disk transfers per second over the last refresh interval.
436: The second row of the display shows the average
1.1 deraadt 437: number of pages transferred per second over the last refresh interval.
438: .Pp
439: Running down the right hand side of the display is a breakdown
440: of the interrupts being handled by the system.
441: At the top of the list is the total interrupts per second
442: over the time interval.
443: The rest of the column breaks down the total on a device
444: by device basis.
445: Only devices that have interrupted at least once since boot time are shown.
1.5 flipk 446: .Pp
447: Below the SWAPPING display and slightly to the left of the Interrupts
1.18 aaron 448: display is a list of virtual memory statistics.
449: The abbreviations are:
1.36 jmc 450: .Pp
1.38 niallo 451: .Bl -tag -compact -width "kmapentXX" -offset indent
1.21 deraadt 452: .It forks
453: process forks
454: .It fkppw
455: forks where parent waits
456: .It fksvm
457: forks where vmspace is shared
458: .It pwait
459: fault had to wait on a page
460: .It relck
461: fault relock called
462: .It rlkok
463: fault relock is successful
464: .It noram
465: faults out of ram
466: .It ndcpy
467: number of times fault clears "need copy"
468: .It fltcp
469: number of times fault promotes with copy
470: .It zfod
471: fault promotes with zerofill
1.5 flipk 472: .It cow
1.21 deraadt 473: number of times fault anon cow
474: .It fmin
475: min number of free pages
476: .It ftarg
477: target number of free pages
478: .It itarg
479: target number of inactive pages
480: .It wired
481: wired pages
1.25 deraadt 482: .It pdfre
1.21 deraadt 483: pages daemon freed since boot
484: .It pdscn
485: pages daemon scanned since boot
1.38 niallo 486: .It pzidle
487: number of zeroed pages
488: .It kmapent
489: number of kernel map entries
1.5 flipk 490: .El
491: .Pp
1.13 aaron 492: The
493: .Ql %zfod
494: value is more interesting when observed over a long
1.5 flipk 495: period, such as from boot time (see the
496: .Cm boot
497: option below).
1.35 markus 498: .El
499: .Pp
500: The following commands are specific to the
501: .Ic vmstat
502: and
503: .Ic ifstat
504: displays; the minimum unambiguous prefix may be supplied.
505: .Pp
506: .Bl -tag -width Ds -compact
507: .It Cm boot
508: Display cumulative statistics since the system was booted.
509: .It Cm run
510: Display statistics as a running total from the point this
511: command is given.
512: .It Cm time
513: Display statistics averaged over the refresh interval (the default).
514: .It Cm zero
515: Reset running statistics to zero.
1.1 deraadt 516: .El
517: .Pp
518: Certain information may be discarded when the screen size is
1.16 aaron 519: insufficient for display.
520: For example, on a machine with 10 drives the
1.1 deraadt 521: .Ic iostat
1.16 aaron 522: bar graph displays only 3 drives on a 24 line terminal.
523: When a bar graph would overflow the allotted screen space it is
524: truncated and the actual value is printed
525: .Dq over top
526: of the bar.
1.1 deraadt 527: .Pp
528: The following commands are common to each display which shows
1.16 aaron 529: information about disk drives.
530: These commands are used to
1.1 deraadt 531: select a set of drives to report on, should your system have
532: more drives configured than can normally be displayed on the
533: screen.
534: .Pp
535: .Bl -tag -width Tx -compact
1.54 jmc 536: .It Cm display Op Ar drives
537: Display information about the drives indicated.
538: Multiple drives may be specified, separated by spaces.
1.1 deraadt 539: .It Cm ignore Op Ar drives
1.16 aaron 540: Do not display information about the drives indicated.
541: Multiple drives may be specified, separated by spaces.
1.1 deraadt 542: .El
543: .Sh FILES
544: .Bl -tag -width /etc/networks -compact
545: .It Pa /etc/hosts
1.22 miod 546: host names
1.1 deraadt 547: .It Pa /etc/networks
1.22 miod 548: network names
1.62 matthieu 549: .It Pa /etc/pf.conf
550: pf and altq configuration
1.1 deraadt 551: .It Pa /etc/services
1.22 miod 552: port names
1.1 deraadt 553: .El
1.15 aaron 554: .Sh SEE ALSO
1.37 jmc 555: .Xt fstat 1 ,
1.15 aaron 556: .Xr kill 1 ,
1.37 jmc 557: .Xr netstat 1 ,
1.15 aaron 558: .Xr ps 1 ,
559: .Xr top 1 ,
1.37 jmc 560: .Xr iostat 8 ,
1.62 matthieu 561: .Xr pfctl 8 ,
1.37 jmc 562: .Xr pstat 8 ,
563: .Xr renice 8 ,
1.48 deanna 564: .Xr sysctl 8 ,
1.37 jmc 565: .Xr vmstat 8
1.1 deraadt 566: .Sh HISTORY
567: The
1.13 aaron 568: .Nm
1.1 deraadt 569: program appeared in
570: .Bx 4.3 .
571: .Sh BUGS
572: Certain displays presume a minimum of 80 characters per line.
573: The
574: .Ic vmstat
575: display looks out of place because it is (it was added in as
576: a separate display rather than created as a new program).