]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/blob - usr.bin/systat/systat.1
MFC 309320,309726,309728
[FreeBSD/stable/10.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 October 24, 2015
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 .Tn TCP/IP
71 statistics,
72 and network connections (a la
73 .Xr netstat 1 ) .
74 .Pp
75 Input is interpreted at two different levels.
76 A ``global'' command interpreter processes all keyboard input.
77 If this command interpreter fails to recognize a command, the
78 input line is passed to a per-display command interpreter.
79 This
80 allows each display to have certain display-specific commands.
81 .Pp
82 Command line options:
83 .Bl -tag -width "refresh_interval"
84 .It Fl Ns Ar display
85 The
86 .Fl
87 flag expects
88 .Ar display
89 to be one of:
90 .Ic icmp ,
91 .Ic icmp6 ,
92 .Ic ifstat ,
93 .Ic iostat ,
94 .Ic ip ,
95 .Ic ip6 ,
96 .Ic netstat ,
97 .Ic pigs ,
98 .Ic sctp ,
99 .Ic swap ,
100 .Ic tcp ,
101 .Ic vmstat ,
102 or
103 .Ic zarc ,
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 sctp
229 Like
230 .Ic icmp ,
231 but with
232 .Tn SCTP
233 statistics.
234 .It Ic tcp
235 Like
236 .Ic icmp ,
237 but with
238 .Tn TCP
239 statistics.
240 .It Ic iostat
241 Display, in the lower window, statistics about processor use
242 and disk throughput.
243 Statistics on processor use appear as
244 bar graphs of the amount of time executing in user mode (``user''),
245 in user mode running low priority processes (``nice''), in
246 system mode (``system''), in interrupt mode (``interrupt''),
247 and idle (``idle'').
248 Statistics
249 on disk throughput show, for each drive, megabytes per second,
250 average number of disk transactions per second, and
251 average kilobytes of data per transaction.
252 This information may be
253 displayed as bar graphs or as rows of numbers which scroll downward.
254 Bar
255 graphs are shown by default.
256 .Pp
257 The following commands are specific to the
258 .Ic iostat
259 display; the minimum unambiguous prefix may be supplied.
260 .Pp
261 .Bl -tag -width Fl -compact
262 .It Cm numbers
263 Show the disk
264 .Tn I/O
265 statistics in numeric form.
266 Values are
267 displayed in numeric columns which scroll downward.
268 .It Cm bars
269 Show the disk
270 .Tn I/O
271 statistics in bar graph form (default).
272 .It Cm kbpt
273 Toggle the display of kilobytes per transaction.
274 (the default is to
275 not display kilobytes per transaction).
276 .El
277 .It Ic swap
278 Show information about swap space usage on all the
279 swap areas compiled into the kernel.
280 The first column is the device name of the partition.
281 The next column is the total space available in the partition.
282 The
283 .Ar Used
284 column indicates the total blocks used so far;
285 the graph shows the percentage of space in use on each partition.
286 If there are more than one swap partition in use,
287 a total line is also shown.
288 Areas known to the kernel, but not in use are shown as not available.
289 .It Ic vmstat
290 Take over the entire display and show a (rather crowded) compendium
291 of statistics related to virtual memory usage, process scheduling,
292 device interrupts, system name translation caching, disk
293 .Tn I/O
294 etc.
295 .Pp
296 The upper left quadrant of the screen shows the number
297 of users logged in and the load average over the last one, five,
298 and fifteen minute intervals.
299 Below this line are statistics on memory utilization.
300 The first row of the table reports memory usage only among
301 active processes, that is processes that have run in the previous
302 twenty seconds.
303 The second row reports on memory usage of all processes.
304 The first column reports on the number of kilobytes in physical pages
305 claimed by processes.
306 The second column reports the number of kilobytes in physical pages that
307 are devoted to read only text pages.
308 The third and fourth columns report the same two figures for
309 virtual pages, that is the number of kilobytes in pages that would be
310 needed if all processes had all of their pages.
311 Finally the last column shows the number of kilobytes in physical pages
312 on the free list.
313 .Pp
314 Below the memory display is a list of the
315 average number of processes (over the last refresh interval)
316 that are runnable (`r'), in page wait (`p'),
317 in disk wait other than paging (`d'),
318 sleeping (`s'), and swapped out but desiring to run (`w').
319 The row also shows the average number of context switches
320 (`Csw'), traps (`Trp'; includes page faults), system calls (`Sys'),
321 interrupts (`Int'), network software interrupts (`Sof'), and page
322 faults (`Flt').
323 .Pp
324 Below the process queue length listing is a numerical listing and
325 a bar graph showing the amount of
326 system (shown as `='), interrupt (shown as `+'), user (shown as `>'),
327 nice (shown as `-'), and idle time (shown as ` ').
328 .Pp
329 Below the process display are statistics on name translations.
330 It lists the number of names translated in the previous interval,
331 the number and percentage of the translations that were
332 handled by the system wide name translation cache, and
333 the number and percentage of the translations that were
334 handled by the per process name translation cache.
335 .Pp
336 To the right of the name translations display are lines showing
337 the number of dirty buffers in the buffer cache (`dtbuf'),
338 desired maximum size of vnode cache (`desvn'),
339 number of vnodes actually allocated (`numvn'),
340 and
341 number of allocated vnodes that are free (`frevn').
342 .Pp
343 At the bottom left is the disk usage display.
344 It reports the number of
345 kilobytes per transaction, transactions per second, megabytes
346 per second and the percentage of the time the disk was busy averaged
347 over the refresh period of the display (by default, five seconds).
348 The system keeps statistics on most every storage device.
349 In general, up
350 to seven devices are displayed.
351 The devices displayed by default are the
352 first devices in the kernel's device list.
353 See
354 .Xr devstat 3
355 and
356 .Xr devstat 9
357 for details on the devstat system.
358 .Pp
359 Under the date in the upper right hand quadrant are statistics
360 on paging and swapping activity.
361 The first two columns report the average number of pages
362 brought in and out per second over the last refresh interval
363 due to page faults and the paging daemon.
364 The third and fourth columns report the average number of pages
365 brought in and out per second over the last refresh interval
366 due to swap requests initiated by the scheduler.
367 The first row of the display shows the average
368 number of disk transfers per second over the last refresh interval;
369 the second row of the display shows the average
370 number of pages transferred per second over the last refresh interval.
371 .Pp
372 Below the paging statistics is a column of lines regarding the virtual
373 memory system.
374 The first few lines describe,
375 in units (except as noted below)
376 of pages per second averaged over the sampling interval,
377 pages copied on write (`cow'),
378 pages zero filled on demand (`zfod'),
379 pages optimally zero filled on demand (`ozfod'),
380 the ratio of the (average) ozfod / zfod as a percentage (`%ozfod'),
381 pages freed by the page daemon (`daefr'),
382 pages freed by exiting processes (`prcfr'),
383 total pages freed (`totfr'),
384 pages reactivated from the free list (`react'),
385 the average number of
386 times per second that the page daemon was awakened (`pdwak'),
387 pages analyzed by the page daemon (`pdpgs'),
388 and
389 in-transit blocking page faults (`intrn').
390 Note that the units are special for `%ozfod' and `pdwak'.
391 The next few lines describe,
392 as amounts of memory in kilobytes,
393 pages wired down (`wire'),
394 active pages (`act'),
395 inactive pages (`inact'),
396 pages on the cache queue (`cache'),
397 and
398 free pages (`free').
399 Note that the values displayed are the current transient ones;
400 they are not averages.
401 .Pp
402 At the bottom of this column is a line showing the
403 amount of virtual memory, in kilobytes, mapped into the buffer cache (`buf').
404 This statistic is not useful.
405 It exists only as a placeholder for the corresponding useful statistic
406 (the amount of real memory used to cache disks).
407 The most important component of the latter (the amount of real memory
408 used by the vm system to cache disks) is not available,
409 but can be guessed from the `inact' amount under some system loads.
410 .Pp
411 Running down the right hand side of the display is a breakdown
412 of the interrupts being handled by the system.
413 At the top of the list is the total interrupts per second
414 over the time interval.
415 The rest of the column breaks down the total on a device
416 by device basis.
417 Only devices that have interrupted at least once since boot time are shown.
418 .Pp
419 The following commands are specific to the
420 .Ic vmstat
421 display; the minimum unambiguous prefix may be supplied.
422 .Pp
423 .Bl -tag -width Ar -compact
424 .It Cm boot
425 Display cumulative statistics since the system was booted.
426 .It Cm run
427 Display statistics as a running total from the point this
428 command is given.
429 .It Cm time
430 Display statistics averaged over the refresh interval (the default).
431 .It Cm zero
432 Reset running statistics to zero.
433 .El
434 .It Ic zarc
435 display arc cache usage and hit/miss statistics.
436 .It Ic netstat
437 Display, in the lower window, network connections.
438 By default,
439 network servers awaiting requests are not displayed.
440 Each address
441 is displayed in the format ``host.port'', with each shown symbolically,
442 when possible.
443 It is possible to have addresses displayed numerically,
444 limit the display to a set of ports, hosts, and/or protocols
445 (the minimum unambiguous prefix may be supplied):
446 .Pp
447 .Bl -tag -width Ar -compact
448 .It Cm all
449 Toggle the displaying of server processes awaiting requests (this
450 is the equivalent of the
451 .Fl a
452 flag to
453 .Xr netstat 1 ) .
454 .It Cm numbers
455 Display network addresses numerically.
456 .It Cm names
457 Display network addresses symbolically.
458 .It Cm proto Ar protocol
459 Display only network connections using the indicated
460 .Ar protocol .
461 Supported protocols are ``tcp'', ``udp'', and ``all''.
462 .It Cm ignore Op Ar items
463 Do not display information about connections associated with
464 the specified hosts or ports.
465 Hosts and ports may be specified
466 by name (``vangogh'', ``ftp''), or numerically.
467 Host addresses
468 use the Internet dot notation (``128.32.0.9'').
469 Multiple items
470 may be specified with a single command by separating them with
471 spaces.
472 .It Cm display Op Ar items
473 Display information about the connections associated with the
474 specified hosts or ports.
475 As for
476 .Ar ignore ,
477 .Op Ar items
478 may be names or numbers.
479 .It Cm show Op Ar ports\&|hosts
480 Show, on the command line, the currently selected protocols,
481 hosts, and ports.
482 Hosts and ports which are being ignored
483 are prefixed with a `!'.
484 If
485 .Ar ports
486 or
487 .Ar hosts
488 is supplied as an argument to
489 .Cm show ,
490 then only the requested information will be displayed.
491 .It Cm reset
492 Reset the port, host, and protocol matching mechanisms to the default
493 (any protocol, port, or host).
494 .El
495 .It Ic ifstat
496 Display the network traffic going through active interfaces on the
497 system.
498 Idle interfaces will not be displayed until they receive some
499 traffic.
500 .Pp
501 For each interface being displayed, the current, peak and total
502 statistics are displayed for incoming and outgoing traffic.
503 By default,
504 the
505 .Ic ifstat
506 display will automatically scale the units being used so that they are
507 in a human-readable format.
508 The scaling units used for the current and
509 peak
510 traffic columns can be altered by the
511 .Ic scale
512 command.
513 .Bl -tag -width ".Cm scale Op Ar units"
514 .It Cm scale Op Ar units
515 Modify the scale used to display the current and peak traffic over all
516 interfaces.
517 The following units are recognised: kbit, kbyte, mbit,
518 mbyte, gbit, gbyte and auto.
519 .It Cm pps
520 Show statistics in packets per second instead of bytes/bits per second.
521 A subsequent call of
522 .Ic pps
523 switches this mode off.
524 .It Cm match Op Ar patterns
525 Display only interfaces that match pattern provided as an argument.
526 Patterns should be in shell syntax separated by whitespaces or commas.
527 If this command is called without arguments then all interfaces are displayed.
528 For example:
529 .Pp
530 .Dl match em0, bge1
531 .Pp
532 This will display em0 and bge1 interfaces.
533 .Pp
534 .Dl match em*, bge*, lo0
535 .Pp
536 This will display all
537 .Ic em
538 interfaces, all
539 .Ic bge
540 interfaces and the loopback interface.
541 .El
542 .El
543 .Pp
544 Commands to switch between displays may be abbreviated to the
545 minimum unambiguous prefix; for example, ``io'' for ``iostat''.
546 Certain information may be discarded when the screen size is
547 insufficient for display.
548 For example, on a machine with 10
549 drives the
550 .Ic iostat
551 bar graph displays only 3 drives on a 24 line terminal.
552 When
553 a bar graph would overflow the allotted screen space it is
554 truncated and the actual value is printed ``over top'' of the bar.
555 .Pp
556 The following commands are common to each display which shows
557 information about disk drives.
558 These commands are used to
559 select a set of drives to report on, should your system have
560 more drives configured than can normally be displayed on the
561 screen.
562 .Pp
563 .Bl -tag -width Ar -compact
564 .It Cm ignore Op Ar drives
565 Do not display information about the drives indicated.
566 Multiple
567 drives may be specified, separated by spaces.
568 .It Cm display Op Ar drives
569 Display information about the drives indicated.
570 Multiple drives
571 may be specified, separated by spaces.
572 .It Cm only Op Ar drives
573 Display only the specified drives.
574 Multiple drives may be specified,
575 separated by spaces.
576 .It Cm drives
577 Display a list of available devices.
578 .It Cm match Xo
579 .Ar type , Ns Ar if , Ns Ar pass
580 .Op | Ar ...
581 .Xc
582 Display devices matching the given pattern.
583 The basic matching
584 expressions are the same as those used in
585 .Xr iostat 8
586 with one difference.
587 Instead of specifying multiple
588 .Fl t
589 arguments which are then ORed together, the user instead specifies multiple
590 matching expressions joined by the pipe
591 .Pq Ql \&|
592 character.
593 The comma
594 separated arguments within each matching expression are ANDed together, and
595 then the pipe separated matching expressions are ORed together.
596 Any
597 device matching the combined expression will be displayed, if there is room
598 to display it.
599 For example:
600 .Pp
601 .Dl match da,scsi | cd,ide
602 .Pp
603 This will display all SCSI Direct Access devices and all IDE CDROM devices.
604 .Pp
605 .Dl match da | sa | cd,pass
606 .Pp
607 This will display all Direct Access devices, all Sequential Access devices,
608 and all passthrough devices that provide access to CDROM drives.
609 .El
610 .Sh FILES
611 .Bl -tag -width /boot/kernel/kernel -compact
612 .It Pa /boot/kernel/kernel
613 For the namelist.
614 .It Pa /dev/kmem
615 For information in main memory.
616 .It Pa /etc/hosts
617 For host names.
618 .It Pa /etc/networks
619 For network names.
620 .It Pa /etc/services
621 For port names.
622 .El
623 .Sh SEE ALSO
624 .Xr netstat 1 ,
625 .Xr kvm 3 ,
626 .Xr icmp 4 ,
627 .Xr icmp6 4 ,
628 .Xr ip 4 ,
629 .Xr ip6 4 ,
630 .Xr tcp 4 ,
631 .Xr udp 4 ,
632 .Xr gstat 8 ,
633 .Xr iostat 8 ,
634 .Xr vmstat 8
635 .Sh HISTORY
636 The
637 .Nm
638 program appeared in
639 .Bx 4.3 .
640 The
641 .Ic icmp ,
642 .Ic ip ,
643 and
644 .Ic tcp
645 displays appeared in
646 .Fx 3.0 ;
647 the notion of having different display modes for the
648 .Tn ICMP ,
649 .Tn IP ,
650 .Tn TCP ,
651 and
652 .Tn UDP
653 statistics was stolen from the
654 .Fl C
655 option to
656 .Xr netstat 1
657 in Silicon Graphics'
658 .Tn IRIX
659 system.
660 .Sh BUGS
661 Certain displays presume a minimum of 80 characters per line.
662 The
663 .Ic vmstat
664 display looks out of place because it is (it was added in as
665 a separate display rather than created as a new program).