]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - usr.bin/systat/systat.1
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.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 .\" 4. 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$
30 .\"
31 .Dd September 17, 2012
32 .Dt SYSTAT 1
33 .Os
34 .Sh NAME
35 .Nm systat
36 .Nd display system statistics
37 .Sh SYNOPSIS
38 .Nm
39 .Op Fl 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 display which uses the entire screen).
52 The
53 upper window depicts the current system load average.
54 The
55 information displayed in the lower window may vary, depending on
56 user commands.
57 The last line on the screen is reserved for user
58 input and error messages.
59 .Pp
60 By default
61 .Nm
62 displays the processes getting the largest percentage of the processor
63 in the lower window.
64 Other displays show swap space usage, disk
65 .Tn I/O
66 statistics (a la
67 .Xr iostat 8 ) ,
68 virtual memory statistics (a la
69 .Xr vmstat 8 ) ,
70 network ``mbuf'' utilization,
71 .Tn TCP/IP
72 statistics,
73 and network connections (a la
74 .Xr netstat 1 ) .
75 .Pp
76 Input is interpreted at two different levels.
77 A ``global'' command interpreter processes all keyboard input.
78 If this command interpreter fails to recognize a command, the
79 input line is passed to a per-display command interpreter.
80 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 swap ,
101 .Ic tcp ,
102 or
103 .Ic vmstat .
104 These displays can also be requested interactively (without the
105 .Dq Fl )
106 and are described in
107 full detail below.
108 .It Ar refresh-interval
109 The
110 .Ar refresh-value
111 specifies the screen refresh time interval in seconds.
112 Time interval can be fractional.
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
128 current character erase, word erase, and line kill characters
129 may be used.
130 .El
131 .Pp
132 The following commands are interpreted by the ``global''
133 command interpreter.
134 .Bl -tag -width Fl
135 .It Ic help
136 Print the names of the available displays on the command line.
137 .It Ic load
138 Print the load average over the past 1, 5, and 15 minutes
139 on the command line.
140 .It Ic stop
141 Stop refreshing the screen.
142 .It Xo
143 .Op Ic start
144 .Op Ar number
145 .Xc
146 Start (continue) refreshing the screen.
147 If a second, numeric,
148 argument is provided it is interpreted as a refresh interval
149 (in seconds).
150 Supplying only a number will set the refresh interval to this
151 value.
152 .It Ic quit
153 Exit
154 .Nm .
155 (This may be abbreviated to
156 .Ic q . )
157 .El
158 .Pp
159 The available displays are:
160 .Bl -tag -width Ic
161 .It Ic pigs
162 Display, in the lower window, those processes resident in main
163 memory and getting the
164 largest portion of the processor (the default display).
165 When less than 100% of the
166 processor is scheduled to user processes, the remaining time
167 is accounted to the ``idle'' process.
168 .It Ic icmp
169 Display, in the lower window, statistics about messages received and
170 transmitted by the Internet Control Message Protocol
171 .Pq Dq Tn ICMP .
172 The left half of the screen displays information about received
173 packets, and the right half displays information regarding transmitted
174 packets.
175 .Pp
176 The
177 .Ic icmp
178 display understands two commands:
179 .Ic mode
180 and
181 .Ic reset .
182 The
183 .Ic mode
184 command is used to select one of four display modes, given as its argument:
185 .Bl -tag -width absoluteXX -compact
186 .It Ic rate :
187 show the rate of change of each value in packets (the default)
188 per second
189 .It Ic delta :
190 show the rate of change of each value in packets per refresh interval
191 .It Ic since :
192 show the total change of each value since the display was last reset
193 .It Ic absolute :
194 show the absolute value of each statistic
195 .El
196 .Pp
197 The
198 .Ic reset
199 command resets the baseline for
200 .Ic since
201 mode.
202 The
203 .Ic mode
204 command with no argument will display the current mode in the command
205 line.
206 .It Ic icmp6
207 This display is like the
208 .Ic icmp
209 display,
210 but displays statistics for IPv6 ICMP.
211 .It Ic ip
212 Otherwise identical to the
213 .Ic icmp
214 display, except that it displays
215 .Tn IP
216 and
217 .Tn UDP
218 statistics.
219 .It Ic ip6
220 Like the
221 .Ic ip
222 display,
223 except that it displays
224 .Tn IPv6
225 statistics.
226 It does not display
227 .Tn UDP statistics.
228 .It Ic tcp
229 Like
230 .Ic icmp ,
231 but with
232 .Tn TCP
233 statistics.
234 .It Ic iostat
235 Display, in the lower window, statistics about processor use
236 and disk throughput.
237 Statistics on processor use appear as
238 bar graphs of the amount of time executing in user mode (``user''),
239 in user mode running low priority processes (``nice''), in
240 system mode (``system''), in interrupt mode (``interrupt''),
241 and idle (``idle'').
242 Statistics
243 on disk throughput show, for each drive, megabytes per second,
244 average number of disk transactions per second, and
245 average kilobytes of data per transaction.
246 This information may be
247 displayed as bar graphs or as rows of numbers which scroll downward.
248 Bar
249 graphs are shown by default.
250 .Pp
251 The following commands are specific to the
252 .Ic iostat
253 display; the minimum unambiguous prefix may be supplied.
254 .Pp
255 .Bl -tag -width Fl -compact
256 .It Cm numbers
257 Show the disk
258 .Tn I/O
259 statistics in numeric form.
260 Values are
261 displayed in numeric columns which scroll downward.
262 .It Cm bars
263 Show the disk
264 .Tn I/O
265 statistics in bar graph form (default).
266 .It Cm kbpt
267 Toggle the display of kilobytes per transaction.
268 (the default is to
269 not display kilobytes per transaction).
270 .El
271 .It Ic swap
272 Show information about swap space usage on all the
273 swap areas compiled into the kernel.
274 The first column is the device name of the partition.
275 The next column is the total space available in the partition.
276 The
277 .Ar Used
278 column indicates the total blocks used so far;
279 the graph shows the percentage of space in use on each partition.
280 If there are more than one swap partition in use,
281 a total line is also shown.
282 Areas known to the kernel, but not in use are shown as not available.
283 .It Ic mbufs
284 Display, in the lower window, the number of mbufs allocated
285 for particular uses, i.e., data, socket structures, etc.
286 .It Ic vmstat
287 Take over the entire display and show a (rather crowded) compendium
288 of statistics related to virtual memory usage, process scheduling,
289 device interrupts, system name translation caching, disk
290 .Tn I/O
291 etc.
292 .Pp
293 The upper left quadrant of the screen shows the number
294 of users logged in and the load average over the last one, five,
295 and fifteen minute intervals.
296 Below this line are statistics on memory utilization.
297 The first row of the table reports memory usage only among
298 active processes, that is processes that have run in the previous
299 twenty seconds.
300 The second row reports on memory usage of all processes.
301 The first column reports on the number of kilobytes in physical pages
302 claimed by processes.
303 The second column reports the number of kilobytes in physical pages that
304 are devoted to read only text pages.
305 The third and fourth columns report the same two figures for
306 virtual pages, that is the number of kilobytes in pages that would be
307 needed if all processes had all of their pages.
308 Finally the last column shows the number of kilobytes in physical pages
309 on the free list.
310 .Pp
311 Below the memory display is a list of the
312 average number of processes (over the last refresh interval)
313 that are runnable (`r'), in page wait (`p'),
314 in disk wait other than paging (`d'),
315 sleeping (`s'), and swapped out but desiring to run (`w').
316 The row also shows the average number of context switches
317 (`Csw'), traps (`Trp'; includes page faults), system calls (`Sys'),
318 interrupts (`Int'), network software interrupts (`Sof'), and page
319 faults (`Flt').
320 .Pp
321 Below the process queue length listing is a numerical listing and
322 a bar graph showing the amount of
323 system (shown as `='), interrupt (shown as `+'), user (shown as `>'),
324 nice (shown as `-'), and idle time (shown as ` ').
325 .Pp
326 Below the process display are statistics on name translations.
327 It lists the number of names translated in the previous interval,
328 the number and percentage of the translations that were
329 handled by the system wide name translation cache, and
330 the number and percentage of the translations that were
331 handled by the per process name translation cache.
332 .Pp
333 To the right of the name translations display are lines showing
334 the number of dirty buffers in the buffer cache (`dtbuf'),
335 desired maximum size of vnode cache (`desvn'),
336 number of vnodes actually allocated (`numvn'),
337 and
338 number of allocated vnodes that are free (`frevn').
339 .Pp
340 At the bottom left is the disk usage display.
341 It reports the number of
342 kilobytes per transaction, transactions per second, megabytes
343 per second and the percentage of the time the disk was busy averaged
344 over the refresh period of the display (by default, five seconds).
345 The system keeps statistics on most every storage device.
346 In general, up
347 to seven devices are displayed.
348 The devices displayed by default are the
349 first devices in the kernel's device list.
350 See
351 .Xr devstat 3
352 and
353 .Xr devstat 9
354 for details on the devstat system.
355 .Pp
356 Under the date in the upper right hand quadrant are statistics
357 on paging and swapping activity.
358 The first two columns report the average number of pages
359 brought in and out per second over the last refresh interval
360 due to page faults and the paging daemon.
361 The third and fourth columns report the average number of pages
362 brought in and out per second over the last refresh interval
363 due to swap requests initiated by the scheduler.
364 The first row of the display shows the average
365 number of disk transfers per second over the last refresh interval;
366 the second row of the display shows the average
367 number of pages transferred per second over the last refresh interval.
368 .Pp
369 Below the paging statistics is a column of lines regarding the virtual
370 memory system.
371 The first few lines describe,
372 in units (except as noted below)
373 of pages per second averaged over the sampling interval,
374 pages copied on write (`cow'),
375 pages zero filled on demand (`zfod'),
376 pages optimally zero filled on demand (`ozfod'),
377 the ratio of the (average) ozfod / zfod as a percentage (`%ozfod'),
378 pages freed by the page daemon (`daefr'),
379 pages freed by exiting processes (`prcfr'),
380 total pages freed (`totfr'),
381 pages reactivated from the free list (`react'),
382 the average number of
383 times per second that the page daemon was awakened (`pdwak'),
384 pages analyzed by the page daemon (`pdpgs'),
385 and
386 in-transit blocking page faults (`intrn').
387 Note that the units are special for `%ozfod' and `pdwak'.
388 The next few lines describe,
389 as amounts of memory in kilobytes,
390 pages wired down (`wire'),
391 active pages (`act'),
392 inactive pages (`inact'),
393 pages on the cache queue (`cache'),
394 and
395 free pages (`free').
396 Note that the values displayed are the current transient ones;
397 they are not averages.
398 .Pp
399 At the bottom of this column is a line showing the
400 amount of virtual memory, in kilobytes, mapped into the buffer cache (`buf').
401 This statistic is not useful.
402 It exists only as a placeholder for the corresponding useful statistic
403 (the amount of real memory used to cache disks).
404 The most important component of the latter (the amount of real memory
405 used by the vm system to cache disks) is not available,
406 but can be guessed from the `inact' amount under some system loads.
407 .Pp
408 Running down the right hand side of the display is a breakdown
409 of the interrupts being handled by the system.
410 At the top of the list is the total interrupts per second
411 over the time interval.
412 The rest of the column breaks down the total on a device
413 by device basis.
414 Only devices that have interrupted at least once since boot time are shown.
415 .Pp
416 The following commands are specific to the
417 .Ic vmstat
418 display; the minimum unambiguous prefix may be supplied.
419 .Pp
420 .Bl -tag -width Ar -compact
421 .It Cm boot
422 Display cumulative statistics since the system was booted.
423 .It Cm run
424 Display statistics as a running total from the point this
425 command is given.
426 .It Cm time
427 Display statistics averaged over the refresh interval (the default).
428 .It Cm zero
429 Reset running statistics to zero.
430 .El
431 .It Ic netstat
432 Display, in the lower window, network connections.
433 By default,
434 network servers awaiting requests are not displayed.
435 Each address
436 is displayed in the format ``host.port'', with each shown symbolically,
437 when possible.
438 It is possible to have addresses displayed numerically,
439 limit the display to a set of ports, hosts, and/or protocols
440 (the minimum unambiguous prefix may be supplied):
441 .Pp
442 .Bl -tag -width Ar -compact
443 .It Cm all
444 Toggle the displaying of server processes awaiting requests (this
445 is the equivalent of the
446 .Fl a
447 flag to
448 .Xr netstat 1 ) .
449 .It Cm numbers
450 Display network addresses numerically.
451 .It Cm names
452 Display network addresses symbolically.
453 .It Cm proto Ar protocol
454 Display only network connections using the indicated
455 .Ar protocol .
456 Supported protocols are ``tcp'', ``udp'', and ``all''.
457 .It Cm ignore Op Ar items
458 Do not display information about connections associated with
459 the specified hosts or ports.
460 Hosts and ports may be specified
461 by name (``vangogh'', ``ftp''), or numerically.
462 Host addresses
463 use the Internet dot notation (``128.32.0.9'').
464 Multiple items
465 may be specified with a single command by separating them with
466 spaces.
467 .It Cm display Op Ar items
468 Display information about the connections associated with the
469 specified hosts or ports.
470 As for
471 .Ar ignore ,
472 .Op Ar items
473 may be names or numbers.
474 .It Cm show Op Ar ports\&|hosts
475 Show, on the command line, the currently selected protocols,
476 hosts, and ports.
477 Hosts and ports which are being ignored
478 are prefixed with a `!'.
479 If
480 .Ar ports
481 or
482 .Ar hosts
483 is supplied as an argument to
484 .Cm show ,
485 then only the requested information will be displayed.
486 .It Cm reset
487 Reset the port, host, and protocol matching mechanisms to the default
488 (any protocol, port, or host).
489 .El
490 .It Ic ifstat
491 Display the network traffic going through active interfaces on the
492 system.
493 Idle interfaces will not be displayed until they receive some
494 traffic.
495 .Pp
496 For each interface being displayed, the current, peak and total
497 statistics are displayed for incoming and outgoing traffic.
498 By default,
499 the
500 .Ic ifstat
501 display will automatically scale the units being used so that they are
502 in a human-readable format.
503 The scaling units used for the current and
504 peak
505 traffic columns can be altered by the
506 .Ic scale
507 command.
508 .Bl -tag -width ".Cm scale Op Ar units"
509 .It Cm scale Op Ar units
510 Modify the scale used to display the current and peak traffic over all
511 interfaces.
512 The following units are recognised: kbit, kbyte, mbit,
513 mbyte, gbit, gbyte and auto.
514 .El
515 .El
516 .Pp
517 Commands to switch between displays may be abbreviated to the
518 minimum unambiguous prefix; for example, ``io'' for ``iostat''.
519 Certain information may be discarded when the screen size is
520 insufficient for display.
521 For example, on a machine with 10
522 drives the
523 .Ic iostat
524 bar graph displays only 3 drives on a 24 line terminal.
525 When
526 a bar graph would overflow the allotted screen space it is
527 truncated and the actual value is printed ``over top'' of the bar.
528 .Pp
529 The following commands are common to each display which shows
530 information about disk drives.
531 These commands are used to
532 select a set of drives to report on, should your system have
533 more drives configured than can normally be displayed on the
534 screen.
535 .Pp
536 .Bl -tag -width Ar -compact
537 .It Cm ignore Op Ar drives
538 Do not display information about the drives indicated.
539 Multiple
540 drives may be specified, separated by spaces.
541 .It Cm display Op Ar drives
542 Display information about the drives indicated.
543 Multiple drives
544 may be specified, separated by spaces.
545 .It Cm only Op Ar drives
546 Display only the specified drives.
547 Multiple drives may be specified,
548 separated by spaces.
549 .It Cm drives
550 Display a list of available devices.
551 .It Cm match Xo
552 .Ar type , Ns Ar if , Ns Ar pass
553 .Op | Ar ...
554 .Xc
555 Display devices matching the given pattern.
556 The basic matching
557 expressions are the same as those used in
558 .Xr iostat 8
559 with one difference.
560 Instead of specifying multiple
561 .Fl t
562 arguments which are then ORed together, the user instead specifies multiple
563 matching expressions joined by the pipe
564 .Pq Ql \&|
565 character.
566 The comma
567 separated arguments within each matching expression are ANDed together, and
568 then the pipe separated matching expressions are ORed together.
569 Any
570 device matching the combined expression will be displayed, if there is room
571 to display it.
572 For example:
573 .Pp
574 .Dl match da,scsi | cd,ide
575 .Pp
576 This will display all SCSI Direct Access devices and all IDE CDROM devices.
577 .Pp
578 .Dl match da | sa | cd,pass
579 .Pp
580 This will display all Direct Access devices, all Sequential Access devices,
581 and all passthrough devices that provide access to CDROM drives.
582 .El
583 .Sh FILES
584 .Bl -tag -width /boot/kernel/kernel -compact
585 .It Pa /boot/kernel/kernel
586 For the namelist.
587 .It Pa /dev/kmem
588 For information in main memory.
589 .It Pa /etc/hosts
590 For host names.
591 .It Pa /etc/networks
592 For network names.
593 .It Pa /etc/services
594 For port names.
595 .El
596 .Sh SEE ALSO
597 .Xr netstat 1 ,
598 .Xr kvm 3 ,
599 .Xr icmp 4 ,
600 .Xr icmp6 4 ,
601 .Xr ip 4 ,
602 .Xr ip6 4 ,
603 .Xr tcp 4 ,
604 .Xr udp 4 ,
605 .Xr gstat 8 ,
606 .Xr iostat 8 ,
607 .Xr vmstat 8
608 .Sh HISTORY
609 The
610 .Nm
611 program appeared in
612 .Bx 4.3 .
613 The
614 .Ic icmp ,
615 .Ic ip ,
616 and
617 .Ic tcp
618 displays appeared in
619 .Fx 3.0 ;
620 the notion of having different display modes for the
621 .Tn ICMP ,
622 .Tn IP ,
623 .Tn TCP ,
624 and
625 .Tn UDP
626 statistics was stolen from the
627 .Fl C
628 option to
629 .Xr netstat 1
630 in Silicon Graphics'
631 .Tn IRIX
632 system.
633 .Sh BUGS
634 Certain displays presume a minimum of 80 characters per line.
635 The
636 .Ic vmstat
637 display looks out of place because it is (it was added in as
638 a separate display rather than created as a new program).