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