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