Use .Fa for struct members.
[dragonfly.git] / usr.bin / systat / systat.1
1 .\" Copyright (c) 1985, 1990, 1993
2 .\"     The Regents of the University of California.  All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\" 3. All advertising materials mentioning features or use of this software
13 .\"    must display the following acknowledgement:
14 .\"     This product includes software developed by the University of
15 .\"     California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\"    may be used to endorse or promote products derived from this software
18 .\"    without specific prior written permission.
19 .\"
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" SUCH DAMAGE.
31 .\"
32 .\"     @(#)systat.1    8.2 (Berkeley) 12/30/93
33 .\" $FreeBSD: src/usr.bin/systat/systat.1,v 1.23.2.9 2002/12/29 16:35:40 schweikh Exp $
34 .\" $DragonFly: src/usr.bin/systat/systat.1,v 1.7 2007/10/04 11:12:34 swildner Exp $
35 .\"
36 .Dd May 31, 2007
37 .Dt SYSTAT 1
38 .Os
39 .Sh NAME
40 .Nm systat
41 .Nd display system statistics on a crt
42 .Sh SYNOPSIS
43 .Nm
44 .Op Fl display
45 .Op Ar refresh-interval
46 .Sh DESCRIPTION
47 The
48 .Nm
49 utility displays various system statistics in a screen oriented fashion
50 using the curses screen display library,
51 .Xr ncurses 3 .
52 .Pp
53 While
54 .Nm
55 is running the screen is usually divided into two windows (an exception
56 is the vmstat display which uses the entire screen).  The
57 upper window depicts the current system load average.  The
58 information displayed in the lower window may vary, depending on
59 user commands.  The last line on the screen is reserved for user
60 input and error messages.
61 .Pp
62 By default
63 .Nm
64 displays the processes getting the largest percentage of the processor
65 in the lower window.  Other displays show swap space usage, disk
66 .Tn I/O
67 statistics (a la
68 .Xr iostat  8  ) ,
69 virtual memory statistics (a la
70 .Xr vmstat  8  ) ,
71 network ``mbuf'' utilization,
72 .Tn TCP/IP
73 statistics,
74 and network connections (a la
75 .Xr netstat  1  ) .
76 .Pp
77 Input is interpreted at two different levels.
78 A ``global'' command interpreter processes all keyboard input.
79 If this command interpreter fails to recognize a command, the
80 input line is passed to a per-display command interpreter.  This
81 allows each display to have certain display-specific commands.
82 .Pp
83 Command line options:
84 .Bl -tag -width "refresh_interval"
85 .It Fl Ns Ar display
86 The
87 .Fl
88 flag expects
89 .Ar display
90 to be one of:
91 .Ic icmp ,
92 .Ic icmp6 ,
93 .Ic ifstat ,
94 .Ic iostat ,
95 .Ic ip ,
96 .Ic ip6 ,
97 .Ic mbufs ,
98 .Ic netstat ,
99 .Ic pigs ,
100 .Ic sensors ,
101 .Ic swap ,
102 .Ic tcp ,
103 or
104 .Ic vmstat .
105 These displays can also be requested interactively (without the
106 .Dq Fl )
107 and are described in
108 full detail below.
109 .It Ar refresh-interval
110 The
111 .Ar refresh-value
112 specifies the screen refresh time interval in seconds.
113 .El
114 .Pp
115 Certain characters cause immediate action by
116 .Nm .
117 These are
118 .Bl -tag -width Fl
119 .It Ic \&^L
120 Refresh the screen.
121 .It Ic \&^G
122 Print the name of the current ``display'' being shown in
123 the lower window and the refresh interval.
124 .It Ic \&:
125 Move the cursor to the command line and interpret the input
126 line typed as a command.  While entering a command the
127 current character erase, word erase, and line kill characters
128 may be used.
129 .El
130 .Pp
131 The following commands are interpreted by the ``global''
132 command interpreter.
133 .Bl -tag -width Fl
134 .It Ic help
135 Print the names of the available displays on the command line.
136 .It Ic load
137 Print the load average over the past 1, 5, and 15 minutes
138 on the command line.
139 .It Ic stop
140 Stop refreshing the screen.
141 .It Xo
142 .Op Ic start
143 .Op Ar number
144 .Xc
145 Start (continue) refreshing the screen.  If a second, numeric,
146 argument is provided it is interpreted as a refresh interval
147 (in seconds).
148 Supplying only a number will set the refresh interval to this
149 value.
150 .It Ic quit
151 Exit
152 .Nm .
153 (This may be abbreviated to
154 .Ic q  . )
155 .El
156 .Pp
157 The available displays are:
158 .Bl -tag -width Ic
159 .It Ic pigs
160 Display, in the lower window, those processes resident in main
161 memory and getting the
162 largest portion of the processor (the default display).
163 When less than 100% of the
164 processor is scheduled to user processes, the remaining time
165 is accounted to the ``idle'' process.
166 .It Ic icmp
167 Display, in the lower window, statistics about messages received and
168 transmitted by the Internet Control Message Protocol
169 .Pq Dq Tn ICMP .
170 The left half of the screen displays information about received
171 packets, and the right half displays information regarding transmitted
172 packets.
173 .Pp
174 The
175 .Ic icmp
176 display understands two commands:
177 .Ic mode
178 and
179 .Ic reset .
180 The
181 .Ic mode
182 command is used to select one of four display modes, given as its argument:
183 .Bl -tag -width absoluteXX -compact
184 .It Ic rate :
185 show the rate of change of each value in packets (the default)
186 per second
187 .It Ic delta :
188 show the rate of change of each value in packets per refresh interval
189 .It Ic since :
190 show the total change of each value since the display was last reset
191 .It Ic absolute :
192 show the absolute value of each statistic
193 .El
194 .Pp
195 The
196 .Ic reset
197 command resets the baseline for
198 .Ic since
199 mode.  The
200 .Ic mode
201 command with no argument will display the current mode in the command
202 line.
203 .It Ic icmp6
204 This display is like the
205 .Ic icmp
206 display,
207 but displays statistics for IPv6 ICMP.
208 .It Ic ip
209 Otherwise identical to the
210 .Ic icmp
211 display, except that it displays
212 .Tn IP
213 and
214 .Tn UDP
215 statistics.
216 .It Ic ip6
217 Like the
218 .Ic ip
219 display,
220 except that it displays
221 .Tn IPv6
222 statics.
223 .It Ic tcp
224 Like
225 .Ic icmp ,
226 but with
227 .Tn TCP
228 statistics.
229 .It Ic ifstat
230 Display, in the lower window, statistics about network throughput on
231 a per-interface basis.
232 .It Ic iostat
233 Display, in the lower window, statistics about processor use
234 and disk throughput.  Statistics on processor use appear as
235 bar graphs of the amount of time executing in user mode (``user''),
236 in user mode running low priority processes (``nice''), in
237 system mode (``system''), in interrupt mode (``interrupt''),
238 and idle (``idle'').  Statistics
239 on disk throughput show, for each drive, megabytes per second,
240 average number of disk transactions per second, and
241 average kilobytes of data per transaction.  This information may be
242 displayed as bar graphs or as rows of numbers which scroll downward.  Bar
243 graphs are shown by default.
244 .Pp
245 The following commands are specific to the
246 .Ic iostat
247 display; the minimum unambiguous prefix may be supplied.
248 .Pp
249 .Bl -tag -width Fl -compact
250 .It Cm numbers
251 Show the disk
252 .Tn I/O
253 statistics in numeric form.  Values are
254 displayed in numeric columns which scroll downward.
255 .It Cm bars
256 Show the disk
257 .Tn I/O
258 statistics in bar graph form (default).
259 .It Cm kbpt
260 Toggle the display of kilobytes per transaction.
261 (the default is to
262 not display kilobytes per transaction).
263 .El
264 .It Ic sensors
265 Display, in the lower window,
266 the current values of available hardware sensors,
267 in a format similar to that of
268 .Xr sysctl 8 .
269 .It Ic swap
270 Show information about swap space usage on all the
271 swap areas compiled into the kernel.
272 The first column is the device name of the partition.
273 The next column is the total space available in the partition.
274 The
275 .Ar Used
276 column indicates the total blocks used so far;
277 the graph shows the percentage of space in use on each partition.
278 If there are more than one swap partition in use,
279 a total line is also shown.
280 Areas known to the kernel, but not in use are shown as not available.
281 .It Ic mbufs
282 Display, in the lower window, the number of mbufs allocated
283 for particular uses, i.e. data, socket structures, etc.
284 .It Ic vmstat
285 Take over the entire display and show a (rather crowded) compendium
286 of statistics related to virtual memory usage, process scheduling,
287 device interrupts, system name translation cacheing, disk
288 .Tn I/O
289 etc.
290 .Pp
291 The upper left quadrant of the screen shows the number
292 of users logged in and the load average over the last one, five,
293 and fifteen minute intervals.
294 Below this line are statistics on memory utilization.
295 The first row of the table reports memory usage only among
296 active processes, that is processes that have run in the previous
297 twenty seconds.
298 The second row reports on memory usage of all processes.
299 The first column reports on the number of physical pages
300 claimed by processes.
301 The second column reports the number of physical pages that
302 are devoted to read only text pages.
303 The third and fourth columns report the same two figures for
304 virtual pages, that is the number of pages that would be
305 needed if all processes had all of their pages.
306 Finally the last column shows the number of physical pages
307 on the free list.
308 .Pp
309 Below the memory display is a list of the
310 average number of processes (over the last refresh interval)
311 that are runnable (`r'), in page wait (`p'),
312 in disk wait other than paging (`d'),
313 sleeping (`s'), and swapped out but desiring to run (`w').
314 The row also shows the average number of context switches
315 (`Csw'), traps (`Trp'; includes page faults), system calls (`Sys'),
316 interrupts (`Int'), network software interrupts (`Sof'), and page
317 faults (`Flt').
318 .Pp
319 Below the process queue length listing is a numerical listing and
320 a bar graph showing the amount of
321 system (shown as `='), interrupt (shown as `+'), user (shown as `>'),
322 nice (shown as `-'), and idle time (shown as ` ').
323 .Pp
324 Below the process display are statistics on name translations.
325 It lists the number of names translated in the previous interval,
326 the number and percentage of the translations that were
327 handled by the system wide name translation cache, and
328 the number and percentage of the translations that were
329 handled by the per process name translation cache.
330 .Pp
331 At the bottom left is the disk usage display.
332 It reports the number of
333 kilobytes per transaction, transactions per second, megabytes
334 per second and the percentage of the time the disk was busy averaged
335 over the refresh period of the display (by default, five seconds).
336 The system keeps statistics on most every storage device.  In general, up
337 to seven devices are displayed.  The devices displayed by default are the
338 first devices in the kernel's device list.  See
339 .Xr devstat 3
340 and
341 .Xr devstat 9
342 for details on the devstat system.
343 .Pp
344 Under the date in the upper right hand quadrant are statistics
345 on paging and swapping activity.
346 The first two columns report the average number of pages
347 brought in and out per second over the last refresh interval
348 due to page faults and the paging daemon.
349 The third and fourth columns report the average number of pages
350 brought in and out per second over the last refresh interval
351 due to swap requests initiated by the scheduler.
352 The first row of the display shows the average
353 number of disk transfers per second over the last refresh interval;
354 the second row of the display shows the average
355 number of pages transferred per second over the last refresh interval.
356 .Pp
357 Below the paging statistics is a column of lines regarding the virtual
358 memory system which list the average number of
359 pages copied on write (`cow'),
360 pages zero filled on demand (`zfod'),
361 slow (on-the-fly) zero fills percentage (`%slo-z'),
362 pages wired down (`wire'),
363 active pages (`act'),
364 inactive pages (`inact'),
365 pages on the buffer cache queue (`cache'),
366 number of free pages (`free'),
367 pages freed by the page daemon (`daefr'),
368 pages freed by exiting processes (`prcfr'),
369 pages reactivated from the free list (`react'),
370 times the page daemon was awakened (`pdwak'),
371 pages analyzed by the page daemon (`pdpgs'),
372 and
373 intransit blocking page faults (`intrn')
374 per second over the refresh interval.
375 .Pp
376 At the bottom of this column are lines showing the
377 amount of memory, in kilobytes, used for the buffer cache (`buf'),
378 the number of dirty buffers in the buffer cache (`dirtybuf'),
379 desired maximum size of vnode cache (`desiredvnodes') (mostly unused,
380 except to size the name cache),
381 number of vnodes actually allocated (`numvnodes'),
382 and
383 number of allocated vnodes that are free (`freevnodes').
384 .Pp
385 Running down the right hand side of the display is a breakdown
386 of the interrupts being handled by the system.
387 At the top of the list is the total interrupts per second
388 over the time interval.
389 The rest of the column breaks down the total on a device
390 by device basis.
391 Only devices that have interrupted at least once since boot time are shown.
392 .Pp
393 The following commands are specific to the
394 .Ic vmstat
395 display; the minimum unambiguous prefix may be supplied.
396 .Pp
397 .Bl -tag -width Ar -compact
398 .It Cm boot
399 Display cumulative statistics since the system was booted.
400 .It Cm run
401 Display statistics as a running total from the point this
402 command is given.
403 .It Cm time
404 Display statistics averaged over the refresh interval (the default).
405 .It Cm want_fd
406 Toggle the display of fd devices in the disk usage display.
407 .It Cm zero
408 Reset running statistics to zero.
409 .El
410 .It Ic netstat
411 Display, in the lower window, network connections.  By default,
412 network servers awaiting requests are not displayed.  Each address
413 is displayed in the format ``host.port'', with each shown symbolically,
414 when possible.  It is possible to have addresses displayed numerically,
415 limit the display to a set of ports, hosts, and/or protocols
416 (the minimum unambiguous prefix may be supplied):
417 .Pp
418 .Bl -tag -width Ar -compact
419 .It Cm all
420 Toggle the displaying of server processes awaiting requests (this
421 is the equivalent of the
422 .Fl a
423 flag to
424 .Xr netstat 1 ) .
425 .It Cm numbers
426 Display network addresses numerically.
427 .It Cm names
428 Display network addresses symbolically.
429 .It Cm proto Ar protocol
430 Display only network connections using the indicated
431 .Ar protocol .
432 Supported protocols are ``tcp'', ``udp'', and ``all''.
433 .It Cm ignore Op Ar items
434 Do not display information about connections associated with
435 the specified hosts or ports.  Hosts and ports may be specified
436 by name (``vangogh'', ``ftp''), or numerically.  Host addresses
437 use the Internet dot notation (``128.32.0.9'').  Multiple items
438 may be specified with a single command by separating them with
439 spaces.
440 .It Cm display Op Ar items
441 Display information about the connections associated with the
442 specified hosts or ports.  As for
443 .Ar ignore  ,
444 .Op Ar items
445 may be names or numbers.
446 .It Cm show Op Ar ports\&|hosts
447 Show, on the command line, the currently selected protocols,
448 hosts, and ports.  Hosts and ports which are being ignored
449 are prefixed with a `!'.  If
450 .Ar ports
451 or
452 .Ar hosts
453 is supplied as an argument to
454 .Cm show  ,
455 then only the requested information will be displayed.
456 .It Cm reset
457 Reset the port, host, and protocol matching mechanisms to the default
458 (any protocol, port, or host).
459 .El
460 .El
461 .Pp
462 Commands to switch between displays may be abbreviated to the
463 minimum unambiguous prefix; for example, ``io'' for ``iostat''.
464 Certain information may be discarded when the screen size is
465 insufficient for display.  For example, on a machine with 10
466 drives the
467 .Ic iostat
468 bar graph displays only 3 drives on a 24 line terminal.  When
469 a bar graph would overflow the allotted screen space it is
470 truncated and the actual value is printed ``over top'' of the bar.
471 .Pp
472 The following commands are common to each display which shows
473 information about disk drives.  These commands are used to
474 select a set of drives to report on, should your system have
475 more drives configured than can normally be displayed on the
476 screen.
477 .Pp
478 .Bl -tag -width Ar -compact
479 .It Cm ignore Op Ar drives
480 Do not display information about the drives indicated.  Multiple
481 drives may be specified, separated by spaces.
482 .It Cm display Op Ar drives
483 Display information about the drives indicated.  Multiple drives
484 may be specified, separated by spaces.
485 .It Cm only Op Ar drives
486 Display only the specified drives.  Multiple drives may be specified,
487 separated by spaces.
488 .It Cm drives
489 Display a list of available devices.
490 .It Cm match Xo
491 .Ar type , Ns Ar if , Ns Ar pass
492 .Op | Ar ...
493 .Xc
494 Display devices matching the given pattern.  The basic matching
495 expressions are the same as those used in
496 .Xr iostat 8
497 with one difference.  Instead of specifying multiple
498 .Fl t
499 arguments which are then ORed together, the user instead specifies multiple
500 matching expressions joined by the pipe
501 .Pq Ql \&|
502 character.
503 The comma
504 separated arguments within each matching expression are ANDed together, and
505 then the pipe separated matching expressions are ORed together.  Any
506 device matching the combined expression will be displayed, if there is room
507 to display it.  For example:
508 .Pp
509 .Dl match da,scsi | cd,ide
510 .Pp
511 This will display all SCSI Direct Access devices and all IDE CDROM devices.
512 .Pp
513 .Dl match da | sa | cd,pass
514 .Pp
515 This will display all Direct Access devices, all Sequential Access devices,
516 and all passthrough devices that provide access to CDROM drives.
517 .El
518 .Sh FILES
519 .Bl -tag -width /etc/networks -compact
520 .It Pa /kernel
521 For the namelist.
522 .It Pa /dev/kmem
523 For information in main memory.
524 .It Pa /etc/hosts
525 For host names.
526 .It Pa /etc/networks
527 For network names.
528 .It Pa /etc/services
529 For port names.
530 .El
531 .Sh SEE ALSO
532 .Xr netstat 1 ,
533 .Xr kvm 3 ,
534 .Xr icmp 4 ,
535 .Xr icmp6 4 ,
536 .Xr ip 4 ,
537 .Xr ip6 4 ,
538 .Xr tcp 4 ,
539 .Xr udp 4 ,
540 .Xr iostat 8 ,
541 .Xr sysctl 8 ,
542 .Xr vmstat 8
543 .Sh HISTORY
544 The
545 .Nm
546 program appeared in
547 .Bx 4.3 .
548 The
549 .Ic icmp ,
550 .Ic ip ,
551 and
552 .Ic tcp
553 displays appeared in
554 .Fx 3.0 ;
555 the notion of having different display modes for the
556 .Tn ICMP ,
557 .Tn IP ,
558 .Tn TCP ,
559 and
560 .Tn UDP
561 statistics was stolen from the
562 .Fl C
563 option to
564 .Xr netstat 1
565 in Silicon Graphics'
566 .Tn IRIX
567 system.
568 .Sh BUGS
569 Certain displays presume a minimum of 80 characters per line.
570 The
571 .Ic vmstat
572 display looks out of place because it is (it was added in as
573 a separate display rather than created as a new program).