summaryrefslogtreecommitdiffstats
path: root/virt-top/virt-top.pod
blob: 4b5781183ae631cf8126185c417145892bfa4e14 (plain)
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
=head1 NAME

virt-top - 'top'-like utility for virtualization stats

=head1 SUMMARY

virt-top [-options]

=head1 DESCRIPTION

virt-top is a L<top(1)>-like utility for showing stats of virtualized
domains.  Many keys and command line options are the same as for
ordinary I<top>.

It uses libvirt so it is capable of showing stats across a variety of
different virtualization systems.

=head1 OPTIONS

=over 4

=item B<-1>

Display physical CPUs by default (instead of domains).
When virt-top is running, use the I<1> key to toggle
between physical CPUs and domains display.

=item B<-2>

Display network interfaces by default (instead of domains).
When virt-top is running, use the I<2> key to toggle
between network interfaces and domains display.

=item B<-3>

Display block devices (virtual disks) by default (instead of domains).
When virt-top is running, use the I<3> key to toggle
between block devices and domains display.

=item B<-b>

Batch mode.  In this mode keypresses are ignored.

=item B<-c uri> or B<--connect uri>

Connect to URI given.  The default is to connect to the Xen
hypervisor.

To connect to QEMU/KVM you would normally do I<-c qemu:///system>

To connect to libvirtd on a remote machine you would normally do
I<-c xen://host/>

Full details on connection URIs is available at
L<http://libvirt.org/uri.html>

=item B<-d delay>

Set the delay between screen updates in seconds.
The default is 3.0 seconds.  You can change this
while virt-top is running by pressing either I<s> or I<d> key.

=item B<-n iterations>

Set the number of iterations to run.  The default
is to run continuously.

=item B<-o sort>

Set the sort order to one of:
B<cpu> (sort by %CPU used),
B<mem> (sort by memory used),
B<time> (sort by total time),
B<id> (sort by domain ID),
B<name> (sort by domain name),
B<netrx> (sort by network received bytes),
B<nettx> (sort by network transmitted bytes),
B<blockrdrq> (sort by block device [disk] read requests),
B<blockwrrq> (sort by block device [disk] write requests).

While virt-top is running you can change the sort
order using keys I<P> (cpu), I<M> (memory),
I<T> (total time), I<N> (domain ID),
I<F> (interactively select the sort field).

=item B<-s>

Secure mode.  Currently this does nothing.

=item B<--hist-cpu secs>

Set the time in seconds between updates of the historical
%CPU at the top right of the display.

=item B<--csv file.csv>

Write the statistics to file I<file.csv>.  First a header is written
showing the statistics being recorded in each column, then one line is
written for each screen update.  The CSV file can be loaded directly
by most spreadsheet programs.

Currently the statistics which this records vary between releases of
virt-top (but the column headers will stay the same, so you can use
those to process the CSV file).

Not every version of virt-top supports CSV output - it depends how the
program was compiled (see I<README> file in the source distribution
for details).

To save space you can compress your CSV files (if your shell supports
this feature, eg. I<bash>):

 virt-top --csv >(gzip -9 > output.csv.gz)

You can use a similar trick to split the CSV file up.  In this example
the CSV file is split every 1000 lines into files called
I<output.csv.00>, I<output.csv.01> etc.

 virt-top --csv >(split -d -l 1000 - output.csv.)

=item B<--no-csv-cpu>

Disable domain CPU stats in CSV output.

=item B<--no-csv-block>

Disable domain block device stats in CSV output.

=item B<--no-csv-net>

Disable domain network interface stats in CSV output.

=item B<--debug filename>

Send debug and error messages to I<filename>.
To send error messages to syslog you can do:

 virt-top --debug >(logger -t virt-top)

See also REPORTING BUGS below.

=item B<--init-file filename>

Read I<filename> as the init file instead of the default which is
I<$HOME/.virt-toprc>.  See also INIT FILE below.

=item B<--no-init-file>

Do not read any init file.

=item B<--script>

Script mode.  There will be no user interface.  This is most useful
when used together with the I<--csv> and I<-n> options.

=item B<--end-time time>

The program will exit at the I<time> given.

The time may be given in one of the following formats:

=over 4

=item I<YYYY-MM-DD HH:MM:SS>

End time is the date and time given.

=item I<HH:MM:SS>

End time is the time given, today.

=item I<+HH:MM:SS>

End time is HH hours, MM minutes, SS seconds in the future (counted
from the moment that program starts).

=item I<+secs>

End time is I<secs> seconds in the future.

=back

For example to run the program for 3 minutes you could do:

 virt-top --end-time +00:03:00

or:

 virt-top --end-time +180

Not every version of virt-top supports this option - it depends how the
program was compiled (see I<README> file in the source distribution
for details).

=item B<--help>

Display usage summary.

=back

=head1 KEYS

Note that keys are case sensitive.  For example use upper-case I<P>
(shift P) to sort by %CPU.  I<^> before a key means a Ctrl key, so
I<^L> is Ctrl L.

=over 4

=item I<space> or I<^L>

Updates the display.

=item I<q>

Quits the program.

=item I<h>

Displays help.

=item I<s> or I<d>

Change the delay between screen updates.

=item I<0> (number 0)

Show the normal list of domains display.

=item I<1> (number 1)

Toggle into showing physical CPUs.  If pressed
again toggles back to showing domains (the normal
display).

=item I<2>

Toggle into showing network interfaces.  If pressed
again toggles back to showing domains.

=item I<3>

Toggle into showing block devices (virtual disks).  If pressed again
toggles back to showing domains.

=item I<P>

Sort by %CPU.

=item I<M>

Sort by memory.

=item I<T>

Sort by total time.

=item I<N>

Sort by domain ID.

=item I<F>

Select the sort field interactively (there are other
sort fields you can choose using this key).

=item I<W>

This creates or overwrites the init file with the current settings.

This key is disabled if I<--no-init-file> was specified on the
command line or if I<overwrite-init-file false> is given in
the init file.

=back

=head1 INIT FILE

When virt-top starts up, it reads initial settings from the
file I<.virt-toprc> in the user's home directory.

The name of this file may be overridden using the I<--init-file
filename> command line option or may be disabled entirely using
I<--no-init-file>.

The init file has a simple format.  Blank lines and comments
beginning with I<#> are ignored.  Everything else is a set of
I<key value> pairs, described below.

=over 4

=item B<display> I<task|pcpu|block|net>

Sets the major display mode to one of I<task> (tasks, the
default), I<pcpu> (physical CPUs), I<block> (block devices),
or I<net> (network interfaces).

=item B<delay> I<secs>

Sets the delay between display updates in seconds.

=item B<hist-cpu> I<secs>

Sets the historical CPU delay in seconds.

=item B<iterations> I<n>

Sets the number of iterations to run before we exit.  Setting
this to I<-1> means to run continuously.

=item B<sort> I<cpu|mem|time|id|name|...>

Sets the sort order.  The option names are the same as for
the command line I<-o> option.

=item B<connect> I<uri>

Sets the default connection URI.

=item B<debug> I<filename>

Sets the default filename to use for debug and error messages.

=item B<csv> I<filename>

Enables CSV output to the named file.

=item B<csv-cpu> I<true|false>

Enable or disable domain CPU stats in CSV output.

=item B<csv-block> I<true|false>

Enable or disable domain block device stats in CSV output.

=item B<csv-net> I<true|false>

Enable or disable domain network interface stats in CSV output.

=item B<batch> I<true|false>

Sets batch mode.

=item B<secure> I<true|false>

Sets secure mode.

=item B<script> I<true|false>

Sets script mode.

=item B<end-time> I<time>

Set the time at which the program exits.  See above for the
time formats supported.

=item B<overwrite-init-file> I<false>

If set to I<false> then the I<W> key will not overwrite the
init file.

=back


Note that in the current implementation, options specified in
the init file override options specified on the command line.
This is a bug and this behaviour may change in the future.

=head1 SEE ALSO

L<top(1)>,
L<virsh(1)>,
L<xm(1)>,
L<xentop(1)>,
L<http://www.libvirt.org/ocaml/>,
L<http://www.libvirt.org/>,
L<http://et.redhat.com/~rjones/>,
L<http://caml.inria.fr/>

=head1 AUTHORS

Richard W.M. Jones <rjones @ redhat . com>

=head1 COPYRIGHT

(C) Copyright 2007 Red Hat Inc., Richard W.M. Jones
http://libvirt.org/

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

=head1 REPORTING BUGS

Bugs can be viewed on the Red Hat Bugzilla page:
L<https://bugzilla.redhat.com/>.

If you find a bug in virt-top, please follow these steps to report it:

=over 4

=item 1. Check for existing bug reports

Go to L<https://bugzilla.redhat.com/> and search for similar bugs.
Someone may already have reported the same bug, and they may even
have fixed it.

=item 2. Capture debug and error messages

Run

 virt-top --debug virt-top.log

and keep I<virt-top.log>.  It contains error messages which you
should submit with your bug report.

=item 3. Get version of virt-top and version of libvirt.

In virt-top, press the I<h> (help) key, and write down the version of
virt-top and the version of libvirt.  They are shown in the first
line.

=item 4. Submit a bug report.

Go to L<https://bugzilla.redhat.com/> and enter a new bug.
Please describe the problem in as much detail as possible.

Remember to include the version numbers (step 3) and the debug
messages file (step 2).

=item 5. Assign the bug to rjones @ redhat.com

Assign or reassign the bug to B<rjones @ redhat.com> (without the
spaces).  You can also send me an email with the bug number if you
want a faster response.

=back