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