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.\" 34.Dd December 30, 1993 35.Dt SYSTAT 1 36.Os BSD 4.3 37.Sh NAME 38.Nm systat 39.Nd display system statistics on a crt 40.Sh SYNOPSIS 41.Nm systat 42.Op Fl display 43.Op Ar refresh-interval 44.Sh DESCRIPTION 45.Nm Systat 46displays various system statistics in a screen oriented fashion 47using the curses screen display library, 48.Xr curses 3 . 49.Pp 50While 51.Nm systat 52is running the screen is usually divided into two windows (an exception 53is the vmstat display which uses the entire screen). The 54upper window depicts the current system load average. The 55information displayed in the lower window may vary, depending on 56user commands. The last line on the screen is reserved for user 57input and error messages. 58.Pp 59By default 60.Nm systat 61displays the processes getting the largest percentage of the processor 62in the lower window. Other displays show swap space usage, disk 63.Tn I/O 64statistics (a la 65.Xr iostat 1 ) , 66virtual memory statistics (a la 67.Xr vmstat 1 ) , 68network ``mbuf'' utilization, and network connections (a la 69.Xr netstat 1 ) . 70.Pp 71Input is interpreted at two different levels. 72A ``global'' command interpreter processes all keyboard input. 73If this command interpreter fails to recognize a command, the 74input line is passed to a per-display command interpreter. This 75allows each display to have certain display-specific commands. 76.Pp 77Command line options: 78.Bl -tag -width "refresh_interval" 79.It Fl Ns Ar display 80The 81.Fl 82flag expects 83.Ar display 84to be one of: 85.Ic pigs , 86.Ic iostat , 87.Ic swap , 88.Ic mbufs , 89.Ic vmstat 90or 91.Ic netstat . 92These displays can also be requested interactively (without the 93.Dq Fl ) 94and are described in 95full detail below. 96.It Ar refresh-interval 97The 98.Ar refresh-value 99specifies the screen refresh time interval in seconds. 100.El 101.Pp 102Certain characters cause immediate action by 103.Nm systat . 104These are 105.Bl -tag -width Fl 106.It Ic \&^L 107Refresh the screen. 108.It Ic \&^G 109Print the name of the current ``display'' being shown in 110the lower window and the refresh interval. 111.It Ic \&^Z 112Stop 113.Nm systat . 114.It Ic \&: 115Move the cursor to the command line and interpret the input 116line typed as a command. While entering a command the 117current character erase, word erase, and line kill characters 118may be used. 119.El 120.Pp 121The following commands are interpreted by the ``global'' 122command interpreter. 123.Bl -tag -width Fl 124.It Ic help 125Print the names of the available displays on the command line. 126.It Ic load 127Print the load average over the past 1, 5, and 15 minutes 128on the command line. 129.It Ic stop 130Stop refreshing the screen. 131.It Xo 132.Op Ic start 133.Op Ar number 134.Xc 135Start (continue) refreshing the screen. If a second, numeric, 136argument is provided it is interpreted as a refresh interval 137(in seconds). 138Supplying only a number will set the refresh interval to this 139value. 140.It Ic quit 141Exit 142.Nm systat . 143(This may be abbreviated to 144.Ic q . ) 145.El 146.Pp 147The available displays are: 148.Bl -tag -width Ic 149.It Ic pigs 150Display, in the lower window, those processes resident in main 151memory and getting the 152largest portion of the processor (the default display). 153When less than 100% of the 154processor is scheduled to user processes, the remaining time 155is accounted to the ``idle'' process. 156.It Ic iostat 157Display, in the lower window, statistics about processor use 158and disk throughput. Statistics on processor use appear as 159bar graphs of the amount of time executing in user mode (``user''), 160in user mode running low priority processes (``nice''), in 161system mode (``system''), and idle (``idle''). Statistics 162on disk throughput show, for each drive, kilobytes of data transferred, 163number of disk transactions performed, and average seek time 164(in milliseconds). This information may be displayed as 165bar graphs or as rows of numbers which scroll downward. Bar 166graphs are shown by default; 167.Pp 168The following commands are specific to the 169.Ic iostat 170display; the minimum unambiguous prefix may be supplied. 171.Pp 172.Bl -tag -width Fl -compact 173.It Cm numbers 174Show the disk 175.Tn I/O 176statistics in numeric form. Values are 177displayed in numeric columns which scroll downward. 178.It Cm bars 179Show the disk 180.Tn I/O 181statistics in bar graph form (default). 182.It Cm msps 183Toggle the display of average seek time (the default is to 184not display seek times). 185.El 186.It Ic swap 187Show information about swap space usage on all the 188swap areas compiled into the kernel. 189The first column is the device name of the partition. 190The next column is the total space available in the partition. 191The 192.Ar Used 193column indicates the total blocks used so far; 194the graph shows the percentage of space in use on each partition. 195If there are more than one swap partition in use, 196a total line is also shown. 197Areas known to the kernel, but not in use are shown as not available. 198.It Ic mbufs 199Display, in the lower window, the number of mbufs allocated 200for particular uses, i.e. data, socket structures, etc. 201.It Ic vmstat 202Take over the entire display and show a (rather crowded) compendium 203of statistics related to virtual memory usage, process scheduling, 204device interrupts, system name translation cacheing, disk 205.Tn I/O 206etc. 207.Pp 208The upper left quadrant of the screen shows the number 209of users logged in and the load average over the last one, five, 210and fifteen minute intervals. 211Below this line are statistics on memory utilization. 212The first row of the table reports memory usage only among 213active processes, that is processes that have run in the previous 214twenty seconds. 215The second row reports on memory usage of all processes. 216The first column reports on the number of physical pages 217claimed by processes. 218The second column reports the number of physical pages that 219are devoted to read only text pages. 220The third and fourth columns report the same two figures for 221virtual pages, that is the number of pages that would be 222needed if all processes had all of their pages. 223Finally the last column shows the number of physical pages 224on the free list. 225.Pp 226Below the memory display is the disk usage display. 227It reports the number of seeks, transfers, and number 228of kilobyte blocks transferred per second averaged over the 229refresh period of the display (by default, five seconds). 230For some disks it also reports the average milliseconds per seek. 231Note that the system only keeps statistics on at most four disks. 232.Pp 233Below the disk display is a list of the 234average number of processes (over the last refresh interval) 235that are runnable (`r'), in page wait (`p'), 236in disk wait other than paging (`d'), 237sleeping (`s'), and swapped out but desiring to run (`w'). 238Below the queue length listing is a numerical listing and 239a bar graph showing the amount of 240system (shown as `='), user (shown as `>'), 241nice (shown as `-'), and idle time (shown as ` '). 242.Pp 243At the bottom left are statistics on name translations. 244It lists the number of names translated in the previous interval, 245the number and percentage of the translations that were 246handled by the system wide name translation cache, and 247the number and percentage of the translations that were 248handled by the per process name translation cache. 249.Pp 250Under the date in the upper right hand quadrant are statistics 251on paging and swapping activity. 252The first two columns report the average number of pages 253brought in and out per second over the last refresh interval 254due to page faults and the paging daemon. 255The third and fourth columns report the average number of pages 256brought in and out per second over the last refresh interval 257due to swap requests initiated by the scheduler. 258The first row of the display shows the average 259number of disk transfers per second over the last refresh interval; 260the second row of the display shows the average 261number of pages transferred per second over the last refresh interval. 262.Pp 263Below the paging statistics is a line listing the average number of 264total reclaims ('Rec'), 265intransit blocking page faults (`It'), 266swap text pages found in free list (`F/S'), 267file system text pages found in free list (`F/F'), 268reclaims from free list 269pages freed by the clock daemon (`Fre'), 270and sequential process pages freed (`SFr') 271per second over the refresh interval. 272.Pp 273Below this line are statistics on the average number of 274zero filled pages (`zf') and demand filled text pages (`xf') 275per second over the refresh period. 276The first row indicates the number of requests that were 277resolved, the second row shows the number that were set up, 278and the last row shows the percentage of setup requests that were 279actually used. 280Note that this percentage is usually less than 100%, 281however it may exceed 100% if a large number of requests 282are actually used long after they were set up during a 283period when no new pages are being set up. 284Thus this figure is most interesting when observed over 285a long time period, such as from boot time 286(see below on getting such a display). 287.Pp 288Below the page fill statistics is a column that 289lists the average number of context switches (`Csw'), 290traps (`Trp'; includes page faults), system calls (`Sys'), interrupts (`Int'), 291characters output to DZ ports using 292.No pseudo Ns -DMA 293(`Pdm'), 294network software interrupts (`Sof'), 295page faults (`Flt'), pages scanned by the page daemon (`Scn'), 296and revolutions of the page daemon's hand (`Rev') 297per second over the refresh interval. 298.Pp 299Running down the right hand side of the display is a breakdown 300of the interrupts being handled by the system. 301At the top of the list is the total interrupts per second 302over the time interval. 303The rest of the column breaks down the total on a device 304by device basis. 305Only devices that have interrupted at least once since boot time are shown. 306.Pp 307The following commands are specific to the 308.Ic vmstat 309display; the minimum unambiguous prefix may be supplied. 310.Pp 311.Bl -tag -width Ar -compact 312.It Cm boot 313Display cumulative statistics since the system was booted. 314.It Cm run 315Display statistics as a running total from the point this 316command is given. 317.It Cm time 318Display statistics averaged over the refresh interval (the default). 319.It Cm zero 320Reset running statistics to zero. 321.El 322.It Ic netstat 323Display, in the lower window, network connections. By default, 324network servers awaiting requests are not displayed. Each address 325is displayed in the format ``host.port'', with each shown symbolically, 326when possible. It is possible to have addresses displayed numerically, 327limit the display to a set of ports, hosts, and/or protocols 328(the minimum unambiguous prefix may be supplied): 329.Pp 330.Bl -tag -width Ar -compact 331.It Cm all 332Toggle the displaying of server processes awaiting requests (this 333is the equivalent of the 334.Fl a 335flag to 336.Ar netstat 1 ) . 337.It Cm numbers 338Display network addresses numerically. 339.It Cm names 340Display network addresses symbolically. 341.It Ar protocol 342Display only network connections using the indicated protocol 343(currently either ``tcp'' or ``udp''). 344.It Cm ignore Op Ar items 345Do not display information about connections associated with 346the specified hosts or ports. Hosts and ports may be specified 347by name (``vangogh'', ``ftp''), or numerically. Host addresses 348use the Internet dot notation (``128.32.0.9''). Multiple items 349may be specified with a single command by separating them with 350spaces. 351.It Cm display Op Ar items 352Display information about the connections associated with the 353specified hosts or ports. As for 354.Ar ignore , 355.Op Ar items 356may be names or numbers. 357.It Cm show Op Ar ports\&|hosts 358Show, on the command line, the currently selected protocols, 359hosts, and ports. Hosts and ports which are being ignored 360are prefixed with a `!'. If 361.Ar ports 362or 363.Ar hosts 364is supplied as an argument to 365.Cm show , 366then only the requested information will be displayed. 367.It Cm reset 368Reset the port, host, and protocol matching mechanisms to the default 369(any protocol, port, or host). 370.El 371.El 372.Pp 373Commands to switch between displays may be abbreviated to the 374minimum unambiguous prefix; for example, ``io'' for ``iostat''. 375Certain information may be discarded when the screen size is 376insufficient for display. For example, on a machine with 10 377drives the 378.Ic iostat 379bar graph displays only 3 drives on a 24 line terminal. When 380a bar graph would overflow the allotted screen space it is 381truncated and the actual value is printed ``over top'' of the bar. 382.Pp 383The following commands are common to each display which shows 384information about disk drives. These commands are used to 385select a set of drives to report on, should your system have 386more drives configured than can normally be displayed on the 387screen. 388.Pp 389.Bl -tag -width Tx -compact 390.It Cm ignore Op Ar drives 391Do not display information about the drives indicated. Multiple 392drives may be specified, separated by spaces. 393.It Cm display Op Ar drives 394Display information about the drives indicated. Multiple drives 395may be specified, separated by spaces. 396.El 397.Sh FILES 398.Bl -tag -width /etc/networks -compact 399.It Pa /vmunix 400For the namelist. 401.It Pa /dev/kmem 402For information in main memory. 403.It Pa /dev/drum 404For information about swapped out processes. 405.It Pa /etc/hosts 406For host names. 407.It Pa /etc/networks 408For network names. 409.It Pa /etc/services 410For port names. 411.El 412.Sh HISTORY 413The 414.Nm systat 415program appeared in 416.Bx 4.3 . 417.Sh BUGS 418Takes 2-10 percent of the cpu. 419Certain displays presume a minimum of 80 characters per line. 420The 421.Ic vmstat 422display looks out of place because it is (it was added in as 423a separate display rather than created as a new program). 424