e823407abe5bced097823fb3f02730ed2af2b32e
[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 .\"
31 .Dd May 24, 2015
32 .Dt SYSTAT 1
33 .Os
34 .Sh NAME
35 .Nm systat
36 .Nd display system statistics on a crt
37 .Sh SYNOPSIS
38 .Nm
39 .Op Fl Ar display
40 .Op Ar refresh-interval
41 .Sh DESCRIPTION
42 The
43 .Nm
44 utility displays various system statistics in a screen oriented fashion
45 using the curses screen display library,
46 .Xr ncurses 3 .
47 .Pp
48 While
49 .Nm
50 is running the screen is usually divided into two windows (an exception
51 is the vmstat and pvmmeter displays which uses the entire screen).
52 The upper window depicts the current system load average.
53 The information displayed in the lower window may vary, depending on
54 user commands.
55 The last line on the screen is reserved for user input and error messages.
56 .Pp
57 By default
58 .Nm
59 displays the processes getting the largest percentage of the processor
60 in the lower window.
61 Other displays show swap space usage, disk
62 .Tn I/O
63 statistics (a la
64 .Xr iostat 8 ) ,
65 virtual memory statistics (a la
66 .Xr vmstat 8 ) ,
67 network ``mbuf'' utilization,
68 .Tn TCP/IP
69 statistics,
70 and network connections (a la
71 .Xr netstat 1 ) .
72 .Pp
73 Input is interpreted at two different levels.
74 A ``global'' command interpreter processes all keyboard input.
75 If this command interpreter fails to recognize a command, the
76 input line is passed to a per-display command interpreter.
77 This allows each display to have certain display-specific commands.
78 .Pp
79 Command line options:
80 .Bl -tag -width "refresh_interval"
81 .It Fl Ns Ar display
82 The
83 .Fl
84 flag expects
85 .Ar display
86 to be one of:
87 .Ic altq ,
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 .Pp
264 The following commands are specific to the
265 .Ic sensors
266 display; the minimum unambiguous prefix may be supplied.
267 .Pp
268 .Bl -tag -width Fl -compact
269 .It Ic type Op Ar type ...
270 Display only the sensors which match the specified
271 .Ar type .
272 Multiple types may be specified,
273 separated by spaces.
274 If no types are specified,
275 all available sensors will be displayed.
276 Supported values of
277 .Ar type
278 are
279 .Cm temp ,
280 .Cm fan ,
281 .Cm volt ,
282 .Cm acvolt ,
283 .Cm resistance ,
284 .Cm power ,
285 .Cm current ,
286 .Cm watthour ,
287 .Cm amphour ,
288 .Cm indicator ,
289 .Cm raw ,
290 .Cm percent ,
291 .Cm illuminance ,
292 .Cm drive ,
293 .Cm timedelta ,
294 and
295 .Cm ecc .
296 .It Ic match Op Ar device ...
297 Display only the sensors match the specified
298 .Ar device .
299 Multiple devices may be specified,
300 separated by spaces.
301 If no devices are specified,
302 all available sensors will be displayed.
303 A device type could be specified by using
304 an asterisk
305 .Pq Sq Li *
306 in the place of the device unit.
307 For example:
308 .Pp
309 .Dl match cpu*
310 .El
311 .It Ic swap
312 Show information about swap space usage on all the
313 swap areas compiled into the kernel.
314 The first column is the device name of the partition.
315 The next column is the total space available in the partition.
316 The ``Used'' column indicates the total blocks used so far;
317 the graph shows the percentage of space in use on each partition.
318 If there are more than one swap partition in use,
319 a total line is also shown.
320 Areas known to the kernel, but not in use are shown as not available.
321 .It Ic mbufs
322 Display, in the lower window, the number of mbufs allocated
323 for particular uses, i.e.\& data, socket structures, etc.
324 .It Ic vmstat
325 Take over the entire display and show a (rather crowded) compendium
326 of statistics related to virtual memory usage, process scheduling,
327 device interrupts, system name translation cacheing, disk
328 .Tn I/O
329 etc.
330 .Pp
331 The upper left quadrant of the screen shows the number
332 of users logged in and the load average over the last one, five,
333 and fifteen minute intervals.
334 .Pp
335 Below this line are statistics on memory utilization.
336 The first row (`Act') reports memory usage only among active processes,
337 that is processes that have run in the previous twenty seconds.
338 The second row (`All') reports on memory usage of all processes.
339 Two groups of columns are shown, `REAL' and `VIRTUAL'.
340 The first column (`Tot') reports on the number of
341 physical pages claimed by processes.
342 The second column (`Share') reports the number of
343 physical pages that are devoted to read only text pages.
344 The third and fourth columns report the same two figures for
345 virtual pages, that is the number of pages that would be
346 needed if all processes had all of their pages.
347 Finally the last column (`Free') shows the number of
348 physical pages on the free list.
349 .Pp
350 Below the memory display is a list of the
351 average number of processes (over the last refresh interval)
352 that are runnable (`r'), in page wait (`p'),
353 in disk wait other than paging (`d'),
354 sleeping (`s'), and swapped out but desiring to run (`w').
355 The row also shows the average number of context switches (`Csw'),
356 traps (`Trp'; includes page faults), system calls (`Sys'), interrupts (`Int'),
357 network software interrupts (`Sof'), and page faults (`Flt').
358 .Pp
359 Below the process queue length listing is a listing of
360 .Tn CPU
361 usage, a numerical listing and a bar graph showing the amount of
362 system (`='), interrupt (`+'), user (`>'), nice (`-'), and idle time (` ').
363 .Pp
364 Below the
365 .Tn CPU
366 usage display are statistics on name translations.
367 It lists the number of path names translated
368 in the previous interval (`Path-lookups'),
369 the number and percentage of the path lookups that were
370 handled by the name translation cache, and
371 the average number of path components in path lookups (`Components').
372 .Pp
373 At the bottom left is the disk usage display.
374 It reports the number of
375 kilobytes per transaction (`KB/t'),
376 read transactions per second (`tpr/s'),
377 megabytes per second in read transaction (`MBr/s'),
378 write transactions per second (`tpw/s'),
379 megabytes per second in write transaction (`MBw/s') and
380 the percentage of the time the disk was busy (`% busy') averaged
381 over the refresh period of the display (by default, five seconds).
382 The system keeps statistics on most every storage device.
383 In general, up to seven devices are displayed.
384 The devices displayed by default are the
385 first devices in the kernel's device list.
386 See
387 .Xr devstat 3
388 and
389 .Xr devstat 9
390 for details on the devstat system.
391 .Pp
392 If at most 4 disk devices are shown,
393 extended virtual memory statistics are shown right to disk usage:
394 pages zero filled on demand (`zfod'),
395 pages optimized zero filled on demand (`ozfod'),
396 slow (i.e.\& non-optimized) zero fills percentage (`%sloz'),
397 total pages freed (`tfree').
398 .Pp
399 Under the date in the upper right hand quadrant are statistics
400 on paging and swapping activity.
401 The first two columns (`VN PAGER') report the average number of pages
402 brought in and out per second over the last refresh interval
403 due to page faults and the paging daemon.
404 The third and fourth columns (`SWAP PAGER') report the average number of pages
405 brought in and out per second over the last refresh interval
406 due to swap requests initiated by the scheduler.
407 The first row (`count') of the display shows the average
408 number of disk transfers per second over the last refresh interval;
409 the second row (`pages') of the display shows the average
410 number of pages transferred per second over the last refresh interval.
411 .Pp
412 Below the paging statistics is a column of lines regarding the virtual
413 memory system which list the average number of
414 pages zero filled on demand (`zfod')
415 (shown with extended virtual memory statistics if screen space permits),
416 pages copied on write (`cow'),
417 pages wired down (`wire'),
418 active pages (`act'),
419 inactive pages (`inact'),
420 pages on the buffer cache queue (`cache'),
421 number of free pages (`free'),
422 pages freed by the page daemon (`daefr'),
423 pages freed by exiting processes (`prcfr'),
424 pages reactivated from the free list (`react'),
425 times the page daemon was awakened (`pdwak'),
426 pages analyzed by the page daemon (`pdpgs'),
427 and
428 intransit blocking page faults (`intrn')
429 per second over the refresh interval.
430 .Pp
431 At the bottom of this column are lines showing the
432 amount of memory, in kilobytes, used for the buffer cache (`buf'),
433 the number of dirty buffers in the buffer cache (`dirtybuf'),
434 desired maximum size of vnode cache (`desiredvnodes')
435 (mostly unused, except to size the name cache),
436 number of vnodes actually allocated (`numvnodes'),
437 and
438 number of allocated vnodes that are free (`freevnodes').
439 .Pp
440 Running down the right hand side of the display is a breakdown
441 of the interrupts being handled by the system (`Interrupts').
442 At the top of the list is the total interrupts per second
443 over the time interval (`total').
444 The rest of the column breaks down the total on a device by device basis.
445 Only devices that have interrupted at least once since boot time are shown.
446 .Pp
447 The following commands are specific to the
448 .Ic vmstat
449 display; the minimum unambiguous prefix may be supplied.
450 .Pp
451 .Bl -tag -width Ar -compact
452 .It Ic boot
453 Display cumulative statistics since the system was booted.
454 .It Ic run
455 Display statistics as a running total from the point this command is given.
456 .It Ic time
457 Display statistics averaged over the refresh interval (the default).
458 .It Ic want_fd
459 Toggle the display of fd devices in the disk usage display.
460 .It Ic zero
461 Reset running statistics to zero.
462 .El
463 .It Ic pvmmeter
464 Display per
465 .Tn CPU
466 statistics, including
467 .Tn LAPIC
468 timer interrupts (`timer'),
469 .Tn IPIs
470 (Inter-Processor Interrupts) (`ipi'),
471 external interrupts (i.e.\& not timer or ipi) (`extint'), and
472 .Tn CPU
473 time breakdown (`user%', `nice%', `sys%', `intr%', and `idle%').
474 .It Ic netstat
475 Display, in the lower window, network connections.
476 By default, network servers awaiting requests are not displayed.
477 Each address is displayed in the format ``host.port'',
478 with each shown symbolically, when possible.
479 It is possible to have addresses displayed numerically,
480 limit the display to a set of ports, hosts, and/or protocols
481 (the minimum unambiguous prefix may be supplied):
482 .Pp
483 .Bl -tag -width Ar -compact
484 .It Ic all
485 Toggle the displaying of server processes awaiting requests (this
486 is the equivalent of the
487 .Fl a
488 flag to
489 .Xr netstat 1 ) .
490 .It Ic numbers
491 Display network addresses numerically.
492 .It Ic names
493 Display network addresses symbolically.
494 .It Ic proto Ar protocol
495 Display only network connections using the indicated
496 .Ar protocol .
497 Supported protocols are
498 .Cm tcp ,
499 .Cm udp ,
500 and
501 .Cm all .
502 .It Ic ignore Op Ar items
503 Do not display information about connections associated with
504 the specified hosts or ports.
505 Hosts and ports may be specified
506 by name (``vangogh'', ``ftp''), or numerically.
507 Host addresses use the Internet dot notation (``128.32.0.9'').
508 Multiple items
509 may be specified with a single command by separating them with spaces.
510 .It Ic display Op Ar items
511 Display information about the connections associated with the
512 specified hosts or ports.
513 As for
514 .Ic ignore ,
515 .Ar items
516 may be names or numbers.
517 .It Ic show Op Cm ports | hosts
518 Show, on the command line, the currently selected protocols, hosts, and ports.
519 Hosts and ports which are being ignored are prefixed with a `!'.
520 If
521 .Cm ports
522 or
523 .Cm hosts
524 is supplied as an argument to
525 .Ic show ,
526 then only the requested information will be displayed.
527 .It Ic reset
528 Reset the port, host, and protocol matching mechanisms to the default
529 (any protocol, port, or host).
530 .El
531 .It Ic netbw
532 Display aggregate and per-connection tcp receive and transmit rates.
533 Only active tcp connections originated or terminated by the host
534 are shown.
535 .It Ic pftop
536 Display packet filter (pf) state information for states which are
537 actively passing data.  This requires pf to be active to be meaningful
538 but is capable of displaying connection state for all packet traffic
539 passing through the machine, even for connections that do not originate
540 or terminate on the machine.
541 .Pp
542 You need a wide ~100 column window to display pftop reasonably well.
543 IPV6 addresses are truncated (just the first two and last two words
544 are displayed) for brevity.  Generally speaking 'rcv' is data received
545 by the first IP and 'snd' is data sent to the second IP.  'ttl' is
546 the sum total data sent plus received tracked by the state.
547 .Pp
548 The display is sorted by average rx+tx bandwidth calculated on a 1/8 decay
549 curve to prevent fields from jumping around too much.  Units for all rows
550 are selected based on the largest bandwidth measurement for uniformity.
551 Note that two states will be present for any connection operating over NAT.
552 .It Ic altq
553 Display packet filter altq statistics.
554 The ALTQ operates in conjunction with the packet filter (pf) on the
555 interface's transmit path.
556 Packet rate, data rate in bytes per interval, drop rate, and queue
557 length is displayed in three separate sections in a convenient
558 INTERFACE-by-ALTQLABEL matrix.
559 .Pp
560 To save space drops
561 and queue length are combined in the third section.
562 If packet drops are present, drops
563 will be displayed, otherwise the packet queue length with a 'Q' suffix
564 will be displayed.
565 .El
566 .Pp
567 Commands to switch between displays may be abbreviated to the
568 minimum unambiguous prefix; for example, ``io'' for ``iostat''.
569 Certain information may be discarded when the screen size is
570 insufficient for display.
571 For example, on a machine with 10 drives the
572 .Ic iostat
573 bar graph displays only 3 drives on a 24 line terminal.
574 When a bar graph would overflow the allotted screen space it is
575 truncated and the actual value is printed ``over top'' of the bar.
576 .Pp
577 The following commands are common to each display which shows
578 information about disk drives.
579 These commands are used to
580 select a set of drives to report on, should your system have
581 more drives configured than can normally be displayed on the screen.
582 .Pp
583 .Bl -tag -width Ar -compact
584 .It Ic ignore Op Ar drives
585 Do not display information about the drives indicated.
586 Multiple drives may be specified, separated by spaces.
587 .It Ic display Op Ar drives
588 Display information about the drives indicated.
589 Multiple drives may be specified, separated by spaces.
590 .It Ic only Op Ar drives
591 Display only the specified drives.
592 Multiple drives may be specified, separated by spaces.
593 .It Ic drives
594 Display a list of available devices.
595 .It Ic match Ar type , Ns Ar if , Ns Ar pass Op | Ar ...
596 Display devices matching the given pattern.
597 The basic matching expressions are the same as those used in
598 .Xr iostat 8
599 with one difference.
600 Instead of specifying multiple
601 .Fl t
602 arguments which are then ORed together, the user instead specifies multiple
603 matching expressions joined by the pipe
604 .Pq Ql \&|
605 character.
606 The comma separated arguments within each matching expression are ANDed
607 together, and then the pipe separated matching expressions are ORed together.
608 Any device matching the combined expression will be displayed,
609 if there is room to display it.
610 For example:
611 .Pp
612 .Dl match da,scsi | cd,ide
613 .Pp
614 This will display all
615 .Tn SCSI
616 Direct Access devices and all
617 .Tn IDE CDROM
618 devices.
619 .Pp
620 .Dl match da | sa | cd,pass
621 .Pp
622 This will display all Direct Access devices, all Sequential Access devices,
623 and all passthrough devices that provide access to
624 .Tn CDROM
625 drives.
626 .El
627 .Sh FILES
628 .Bl -tag -width /etc/networks -compact
629 .It Pa /boot/kernel
630 For the namelist.
631 .It Pa /dev/kmem
632 For information in main memory.
633 .It Pa /etc/hosts
634 For host names.
635 .It Pa /etc/networks
636 For network names.
637 .It Pa /etc/services
638 For port names.
639 .El
640 .Sh SEE ALSO
641 .Xr netstat 1 ,
642 .Xr kvm 3 ,
643 .Xr icmp 4 ,
644 .Xr icmp6 4 ,
645 .Xr ip 4 ,
646 .Xr ip6 4 ,
647 .Xr tcp 4 ,
648 .Xr udp 4 ,
649 .Xr iostat 8 ,
650 .Xr sysctl 8 ,
651 .Xr vmstat 8
652 .Sh HISTORY
653 The
654 .Nm
655 program appeared in
656 .Bx 4.3 .
657 The
658 .Ic icmp ,
659 .Ic ip ,
660 and
661 .Ic tcp
662 displays appeared in
663 .Fx 3.0 ;
664 the notion of having different display modes for the
665 .Tn ICMP ,
666 .Tn IP ,
667 .Tn TCP ,
668 and
669 .Tn UDP
670 statistics was stolen from the
671 .Fl C
672 option to
673 .Xr netstat 1
674 in Silicon Graphics'
675 .Tn IRIX
676 system.
677 .Sh BUGS
678 Certain displays presume a minimum of 80 characters per line.
679 The
680 .Ic vmstat
681 display looks out of place because it is (it was added in as
682 a separate display rather than created as a new program).