1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
|
.\" $OpenBSD: systat.1,v 1.58 2007/10/31 16:19:25 jmc Exp $
.\" $NetBSD: systat.1,v 1.6 1996/05/10 23:16:39 thorpej Exp $
.\"
.\" Copyright (c) 1985, 1990, 1993
.\" The Regents of the University of California. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. Neither the name of the University nor the names of its contributors
.\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" @(#)systat.1 8.2 (Berkeley) 12/30/93
.\"
.Dd $Mdocdate: October 31 2007 $
.Dt SYSTAT 1
.Os
.Sh NAME
.Nm systat
.Nd display system statistics
.Sh SYNOPSIS
.Nm systat
.Op Fl n
.Op Fl w Ar wait
.Op Ar display
.Op Ar refresh-interval
.Sh DESCRIPTION
.Nm
displays various system statistics in a screen oriented fashion
using the curses screen display library,
.Xr curses 3 .
.Pp
While
.Nm
is running the screen is usually divided into two windows (an exception
is the vmstat display which uses the entire screen).
The upper window depicts the current system load average.
The information displayed in the lower window may vary, depending on
user commands.
The last line on the screen is reserved for user
input and error messages.
.Pp
By default
.Nm
displays the processes getting the largest percentage of the processor
in the lower window.
Other displays show swap space usage, disk
.Tn I/O
statistics (a la
.Xr iostat 8 ) ,
virtual memory statistics (a la
.Xr vmstat 8 ) ,
network
.Dq mbuf
utilization, and network connections (a la
.Xr netstat 1 ) .
.Pp
Input is interpreted at two different levels.
A
.Dq global
command interpreter processes all keyboard input.
If this command interpreter fails to recognize a command, the
input line is passed to a per-display command interpreter.
This allows each display to have certain display-specific commands.
.Pp
The options are as follows:
.Bl -tag -width "refresh-interval"
.It Fl n
Do not try to reverse-map IP address.
.It Fl w Ar wait
Specifies the screen refresh time interval in seconds.
This option is overridden by
.Ar refresh-interval ,
if given.
The default interval is 5 seconds.
.It Ar display
The
.Ar display
argument expects to be one of:
.Ic pigs ,
.Ic iostat ,
.Ic swap ,
.Ic sensors ,
.Ic mbufs ,
.Ic vmstat ,
.Ic ifstat
or
.Ic netstat .
These displays can also be requested interactively and are described in
full detail below.
.Ar display
may be abbreviated to the minimum unambiguous prefix;
for example,
.Dq io
for
.Dq iostat .
.It Ar refresh-interval
The
.Ar refresh-interval
specifies the screen refresh time interval in seconds.
This is provided for backwards compatibility, and overrides the
.Ar wait
interval specified with the
.Fl w
flag.
The default interval is 5 seconds.
.El
.Pp
Certain characters cause immediate action by
.Nm systat .
These are
.Bl -tag -width Fl
.It Ic \&^L
Refresh the screen.
.It Ic \&^G
Print the name of the current
.Dq display
being shown in
the lower window and the refresh interval.
.It Ic \&^Z
Suspend
.Nm systat .
.It Ic \&:
Move the cursor to the command line and interpret the input
line typed as a command.
While entering a command the
current character erase, word erase, and line kill characters
may be used.
.El
.Pp
The following commands are interpreted by the
.Dq global
command interpreter.
.Bl -tag -width Fl
.It Ic help
Print the names of the available displays on the command line.
.It Ic load
Print the load average over the past 1, 5, and 15 minutes
on the command line.
.It Ic quit
Exit
.Nm systat .
(This may be abbreviated to
.Ic q . )
.It Ic stop
Stop refreshing the screen.
.It Xo
.Op Ic start
.Op Ar number
.Xc
Start (continue) refreshing the screen.
If a second, numeric,
argument is provided it is interpreted as a refresh interval
(in seconds).
Supplying only a number will set the refresh interval to this
value.
.El
.Pp
Again,
.Ar display
may be abbreviated to the minimum unambiguous prefix.
The available displays are:
.Bl -tag -width "netstatXXX"
.It Ic ifstat
Display, in the lower window, interface statistics.
The
.Dq State
column has the format
.Sm off
.Xo
.Cm up \*(Ba dn
.Bq : Cm U \*(Ba D .
.Xc
.Sm on
.Sq up
and
.Sq dn
represent whether the interface is up or down.
.Sq U
and
.Sq D
represent whether the interface is connected or not;
in the case of
.Xr carp 4
interfaces, whether the interface is in master or backup state, respectively.
See below for more options.
.It Ic iostat
Display, in the lower window, statistics about disk throughput.
Statistics
on disk throughput show, for each drive, data transferred in kilobytes,
number of disk transactions performed, and time spent in disk accesses
(in fractions of a second).
.It Ic mbufs
Display, in the lower window, the number of mbufs allocated
for particular uses, i.e., data, socket structures, etc.
.It Ic netstat
Display, in the lower window, network connections.
By default, network servers awaiting requests are not displayed.
Each address
is displayed in the format
.Dq host.port ,
with each shown symbolically, when possible.
It is possible to have addresses displayed numerically,
limit the display to a set of ports, hosts, and/or protocols
(the minimum unambiguous prefix may be supplied):
.Bl -tag -width Ar
.It Cm all
Toggle the displaying of server processes awaiting requests (this
is the equivalent of the
.Fl a
flag to
.Xr netstat 1 ) .
.It Cm display Op Ar items
Display information about the connections associated with the
specified hosts or ports.
As for
.Ar ignore ,
.Ar items
may be names or numbers.
.It Cm ignore Op Ar items
Do not display information about connections associated with
the specified hosts or ports.
Hosts and ports may be specified
by name
.Pf ( Dq vangogh ,
.Dq ftp ) ,
or numerically.
Host addresses
use the Internet dot notation
.Pq Dq 128.32.0.9 .
Multiple items
may be specified with a single command by separating them with
spaces.
.It Cm names
Display network addresses symbolically.
.It Cm numbers
Display network addresses numerically.
.It Cm reset
Reset the port, host, and protocol matching mechanisms to the default
(any protocol, port, or host).
.It Cm show Op Ar protos\&|ports\&|hosts
Show, on the command line, the currently selected protocols,
hosts, and ports.
Protocols, hosts and ports which are being ignored are prefixed with a
.Ql \&! .
If an argument is supplied to
.Cm show ,
then only the requested information will be displayed.
.It Cm tcp \*(Ba udp \*(Ba all
Display only network connections using the indicated protocol.
.El
.It Ic pigs
Display, in the lower window, those processes resident in main
memory and getting the
largest portion of the processor (the default display).
When less than 100% of the
processor is scheduled to user processes, the remaining time
is accounted to the
.Dq idle
process.
.It Ic sensors
Display, in the lower window,
the current values of available hardware sensors,
in a format similar to that of
.Xr sysctl 8 .
.It Ic swap
Show information about swap space usage on all the
swap areas compiled into the kernel.
The first column is the device name of the partition.
The next column is the total space available in the partition.
The
.Ar Used
column indicates the total blocks used so far;
the graph shows the percentage of space in use on each partition.
If there is more than one swap partition in use,
a total line is also shown.
Areas known to the kernel but not in use are shown as not available.
.It Ic vmstat
Take over the entire display and show a (rather crowded) compendium
of statistics related to virtual memory usage, process scheduling,
device interrupts, system name translation caching, disk
.Tn I/O
etc.
.Pp
The upper left quadrant of the screen shows the number
of users logged in and the load average over the last 1, 5,
and 15 minute intervals.
Below this line are statistics on memory utilization.
The first row of the table reports memory usage only among
active processes, that is, processes that have run in the previous
twenty seconds.
The second row reports on memory usage of all processes.
The first column reports on the amount of physical memory
claimed by processes.
The second column reports the same figure for
virtual memory, that is, the amount of memory that would be
needed if all processes were resident at the same time.
Finally, the last column shows the amount of physical memory
on the free list.
.Pp
Below the memory display is a list of the average number of processes
(over the last refresh interval) that are runnable
.Pq Sq r ,
in disk wait other than paging
.Pq Sq d ,
sleeping
.Pq Sq s ,
and swapped out but desiring to run
.Pq Sq w .
Below the queue length listing is a numerical listing and
a bar graph showing the amount of
interrupt (shown as
.Ql | ) ,
system (shown as
.Ql = ) ,
user (shown as
.Ql \*(Gt ) ,
nice (shown as
.Ql - ) ,
and idle time (shown as
.Ql \ \& ) .
.Pp
To the right of the Proc display are statistics about
Context switches
.Pq Dq Csw ,
Traps
.Pq Dq Trp ,
Syscalls
.Pq Dq Sys ,
Interrupts
.Pq Dq Int ,
Soft interrupts
.Pq Dq Sof ,
and Faults
.Pq Dq Flt
which have occurred during the last refresh interval.
.Pp
Below the CPU Usage graph are statistics on name translations.
It lists the number of names translated in the previous interval,
the number and percentage of the translations that were
handled by the system wide name translation cache, and
the number and percentage of the translations that were
handled by the per process name translation cache.
.Pp
At the bottom left is the disk usage display.
It reports the number of seeks, transfers, number
of kilobyte blocks transferred per second averaged over the
refresh period of the display (by default, five seconds), and
the time spent in disk accesses.
.Pp
Under the date in the upper right hand quadrant are statistics
on paging and swapping activity.
The first two columns report the average number of pages
brought in and out per second over the last refresh interval
due to page faults and the paging daemon.
The third and fourth columns report the average number of pages
brought in and out per second over the last refresh interval
due to swap requests initiated by the scheduler.
The first row of the display shows the average
number of disk transfers per second over the last refresh interval.
The second row of the display shows the average
number of pages transferred per second over the last refresh interval.
.Pp
Running down the right hand side of the display is a breakdown
of the interrupts being handled by the system.
At the top of the list is the total interrupts per second
over the time interval.
The rest of the column breaks down the total on a device
by device basis.
Only devices that have interrupted at least once since boot time are shown.
.Pp
Below the SWAPPING display and slightly to the left of the Interrupts
display is a list of virtual memory statistics.
The abbreviations are:
.Pp
.Bl -tag -compact -width "kmapentXX" -offset indent
.It forks
process forks
.It fkppw
forks where parent waits
.It fksvm
forks where vmspace is shared
.It pwait
fault had to wait on a page
.It relck
fault relock called
.It rlkok
fault relock is successful
.It noram
faults out of ram
.It ndcpy
number of times fault clears "need copy"
.It fltcp
number of times fault promotes with copy
.It zfod
fault promotes with zerofill
.It cow
number of times fault anon cow
.It fmin
min number of free pages
.It ftarg
target number of free pages
.It itarg
target number of inactive pages
.It wired
wired pages
.It pdfre
pages daemon freed since boot
.It pdscn
pages daemon scanned since boot
.It pzidle
number of zeroed pages
.It kmapent
number of kernel map entries
.El
.Pp
The
.Ql %zfod
value is more interesting when observed over a long
period, such as from boot time (see the
.Cm boot
option below).
.El
.Pp
The following commands are specific to the
.Ic vmstat
and
.Ic ifstat
displays; the minimum unambiguous prefix may be supplied.
.Pp
.Bl -tag -width Ds -compact
.It Cm boot
Display cumulative statistics since the system was booted.
.It Cm run
Display statistics as a running total from the point this
command is given.
.It Cm time
Display statistics averaged over the refresh interval (the default).
.It Cm zero
Reset running statistics to zero.
.El
.Pp
Certain information may be discarded when the screen size is
insufficient for display.
For example, on a machine with 10 drives the
.Ic iostat
bar graph displays only 3 drives on a 24 line terminal.
When a bar graph would overflow the allotted screen space it is
truncated and the actual value is printed
.Dq over top
of the bar.
.Pp
The following commands are common to each display which shows
information about disk drives.
These commands are used to
select a set of drives to report on, should your system have
more drives configured than can normally be displayed on the
screen.
.Pp
.Bl -tag -width Tx -compact
.It Cm display Op Ar drives
Display information about the drives indicated.
Multiple drives may be specified, separated by spaces.
.It Cm ignore Op Ar drives
Do not display information about the drives indicated.
Multiple drives may be specified, separated by spaces.
.El
.Sh FILES
.Bl -tag -width /etc/networks -compact
.It Pa /etc/hosts
host names
.It Pa /etc/networks
network names
.It Pa /etc/services
port names
.El
.Sh SEE ALSO
.Xt fstat 1 ,
.Xr kill 1 ,
.Xr netstat 1 ,
.Xr ps 1 ,
.Xr top 1 ,
.Xr iostat 8 ,
.Xr pstat 8 ,
.Xr renice 8 ,
.Xr sysctl 8 ,
.Xr vmstat 8
.Sh HISTORY
The
.Nm
program appeared in
.Bx 4.3 .
.Sh BUGS
Certain displays presume a minimum of 80 characters per line.
The
.Ic vmstat
display looks out of place because it is (it was added in as
a separate display rather than created as a new program).
|