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