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