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