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