Fix native virt-ctrl on Windows.
[virt-top.git] / virt-top / virt-top.pod
1 =head1 NAME
2
3 virt-top - 'top'-like utility for virtualization stats
4
5 =head1 SUMMARY
6
7 virt-top [-options]
8
9 =head1 DESCRIPTION
10
11 virt-top is a L<top(1)>-like utility for showing stats of virtualized
12 domains.  Many keys and command line options are the same as for
13 ordinary I<top>.
14
15 It uses libvirt so it is capable of showing stats across a variety of
16 different virtualization systems.
17
18 =head1 OPTIONS
19
20 =over 4
21
22 =item B<-1>
23
24 Display physical CPUs by default (instead of domains).
25 When virt-top is running, use the I<1> key to toggle
26 between physical CPUs and domains display.
27
28 =item B<-2>
29
30 Display network interfaces by default (instead of domains).
31 When virt-top is running, use the I<2> key to toggle
32 between network interfaces and domains display.
33
34 =item B<-3>
35
36 Display block devices (virtual disks) by default (instead of domains).
37 When virt-top is running, use the I<3> key to toggle
38 between block devices and domains display.
39
40 =item B<-b>
41
42 Batch mode.  In this mode keypresses are ignored.
43
44 =item B<-c uri> or B<--connect uri>
45
46 Connect to URI given.  The default is to connect to the Xen
47 hypervisor.
48
49 To connect to QEMU/KVM you would normally do I<-c qemu:///system>
50
51 To connect to libvirtd on a remote machine you would normally do
52 I<-c xen://host/>
53
54 Full details on connection URIs is available at
55 L<http://libvirt.org/uri.html>
56
57 =item B<-d delay>
58
59 Set the delay between screen updates in seconds.
60 The default is 3.0 seconds.  You can change this
61 while virt-top is running by pressing either I<s> or I<d> key.
62
63 =item B<-n iterations>
64
65 Set the number of iterations to run.  The default
66 is to run continuously.
67
68 =item B<-o sort>
69
70 Set the sort order to one of:
71 B<cpu> (sort by %CPU used),
72 B<mem> (sort by memory used),
73 B<time> (sort by total time),
74 B<id> (sort by domain ID),
75 B<name> (sort by domain name),
76 B<netrx> (sort by network received bytes),
77 B<nettx> (sort by network transmitted bytes),
78 B<blockrdrq> (sort by block device [disk] read requests),
79 B<blockwrrq> (sort by block device [disk] write requests).
80
81 While virt-top is running you can change the sort
82 order using keys I<P> (cpu), I<M> (memory),
83 I<T> (total time), I<N> (domain ID),
84 I<F> (interactively select the sort field).
85
86 =item B<-s>
87
88 Secure mode.  Currently this does nothing.
89
90 =item B<--hist-cpu secs>
91
92 Set the time in seconds between updates of the historical
93 %CPU at the top right of the display.
94
95 =item B<--csv file.csv>
96
97 Write the statistics to file I<file.csv>.  First a header is written
98 showing the statistics being recorded in each column, then one line is
99 written for each screen update.  The CSV file can be loaded directly
100 by most spreadsheet programs.
101
102 Currently the statistics which this records vary between releases of
103 virt-top (but the column headers will stay the same, so you can use
104 those to process the CSV file).
105
106 Not every version of virt-top supports CSV output - it depends how the
107 program was compiled (see I<README> file in the source distribution
108 for details).
109
110 To save space you can compress your CSV files (if your shell supports
111 this feature, eg. I<bash>):
112
113  virt-top --csv >(gzip -9 > output.csv.gz)
114
115 You can use a similar trick to split the CSV file up.  In this example
116 the CSV file is split every 1000 lines into files called
117 I<output.csv.00>, I<output.csv.01> etc.
118
119  virt-top --csv >(split -d -l 1000 - output.csv.)
120
121 =item B<--no-csv-cpu>
122
123 Disable domain CPU stats in CSV output.
124
125 =item B<--no-csv-block>
126
127 Disable domain block device stats in CSV output.
128
129 =item B<--no-csv-net>
130
131 Disable domain network interface stats in CSV output.
132
133 =item B<--debug filename>
134
135 Send debug and error messages to I<filename>.
136 To send error messages to syslog you can do:
137
138  virt-top --debug >(logger -t virt-top)
139
140 See also REPORTING BUGS below.
141
142 =item B<--init-file filename>
143
144 Read I<filename> as the init file instead of the default which is
145 I<$HOME/.virt-toprc>.  See also INIT FILE below.
146
147 =item B<--no-init-file>
148
149 Do not read any init file.
150
151 =item B<--script>
152
153 Script mode.  There will be no user interface.  This is most useful
154 when used together with the I<--csv> and I<-n> options.
155
156 =item B<--end-time time>
157
158 The program will exit at the I<time> given.
159
160 The time may be given in one of the following formats:
161
162 =over 4
163
164 =item I<YYYY-MM-DD HH:MM:SS>
165
166 End time is the date and time given.
167
168 =item I<HH:MM:SS>
169
170 End time is the time given, today.
171
172 =item I<+HH:MM:SS>
173
174 End time is HH hours, MM minutes, SS seconds in the future (counted
175 from the moment that program starts).
176
177 =item I<+secs>
178
179 End time is I<secs> seconds in the future.
180
181 =back
182
183 For example to run the program for 3 minutes you could do:
184
185  virt-top --end-time +00:03:00
186
187 or:
188
189  virt-top --end-time +180
190
191 Not every version of virt-top supports this option - it depends how the
192 program was compiled (see I<README> file in the source distribution
193 for details).
194
195 =item B<--help>
196
197 Display usage summary.
198
199 =back
200
201 =head1 KEYS
202
203 Note that keys are case sensitive.  For example use upper-case I<P>
204 (shift P) to sort by %CPU.  I<^> before a key means a Ctrl key, so
205 I<^L> is Ctrl L.
206
207 =over 4
208
209 =item I<space> or I<^L>
210
211 Updates the display.
212
213 =item I<q>
214
215 Quits the program.
216
217 =item I<h>
218
219 Displays help.
220
221 =item I<s> or I<d>
222
223 Change the delay between screen updates.
224
225 =item I<0> (number 0)
226
227 Show the normal list of domains display.
228
229 =item I<1> (number 1)
230
231 Toggle into showing physical CPUs.  If pressed
232 again toggles back to showing domains (the normal
233 display).
234
235 =item I<2>
236
237 Toggle into showing network interfaces.  If pressed
238 again toggles back to showing domains.
239
240 =item I<3>
241
242 Toggle into showing block devices (virtual disks).  If pressed again
243 toggles back to showing domains.
244
245 =item I<P>
246
247 Sort by %CPU.
248
249 =item I<M>
250
251 Sort by memory.
252
253 =item I<T>
254
255 Sort by total time.
256
257 =item I<N>
258
259 Sort by domain ID.
260
261 =item I<F>
262
263 Select the sort field interactively (there are other
264 sort fields you can choose using this key).
265
266 =item I<W>
267
268 This creates or overwrites the init file with the current settings.
269
270 This key is disabled if I<--no-init-file> was specified on the
271 command line or if I<overwrite-init-file false> is given in
272 the init file.
273
274 =back
275
276 =head1 INIT FILE
277
278 When virt-top starts up, it reads initial settings from the
279 file I<.virt-toprc> in the user's home directory.
280
281 The name of this file may be overridden using the I<--init-file
282 filename> command line option or may be disabled entirely using
283 I<--no-init-file>.
284
285 The init file has a simple format.  Blank lines and comments
286 beginning with I<#> are ignored.  Everything else is a set of
287 I<key value> pairs, described below.
288
289 =over 4
290
291 =item B<display> I<task|pcpu|block|net>
292
293 Sets the major display mode to one of I<task> (tasks, the
294 default), I<pcpu> (physical CPUs), I<block> (block devices),
295 or I<net> (network interfaces).
296
297 =item B<delay> I<secs>
298
299 Sets the delay between display updates in seconds.
300
301 =item B<hist-cpu> I<secs>
302
303 Sets the historical CPU delay in seconds.
304
305 =item B<iterations> I<n>
306
307 Sets the number of iterations to run before we exit.  Setting
308 this to I<-1> means to run continuously.
309
310 =item B<sort> I<cpu|mem|time|id|name|...>
311
312 Sets the sort order.  The option names are the same as for
313 the command line I<-o> option.
314
315 =item B<connect> I<uri>
316
317 Sets the default connection URI.
318
319 =item B<debug> I<filename>
320
321 Sets the default filename to use for debug and error messages.
322
323 =item B<csv> I<filename>
324
325 Enables CSV output to the named file.
326
327 =item B<csv-cpu> I<true|false>
328
329 Enable or disable domain CPU stats in CSV output.
330
331 =item B<csv-block> I<true|false>
332
333 Enable or disable domain block device stats in CSV output.
334
335 =item B<csv-net> I<true|false>
336
337 Enable or disable domain network interface stats in CSV output.
338
339 =item B<batch> I<true|false>
340
341 Sets batch mode.
342
343 =item B<secure> I<true|false>
344
345 Sets secure mode.
346
347 =item B<script> I<true|false>
348
349 Sets script mode.
350
351 =item B<end-time> I<time>
352
353 Set the time at which the program exits.  See above for the
354 time formats supported.
355
356 =item B<overwrite-init-file> I<false>
357
358 If set to I<false> then the I<W> key will not overwrite the
359 init file.
360
361 =back
362
363
364 Note that in the current implementation, options specified in
365 the init file override options specified on the command line.
366 This is a bug and this behaviour may change in the future.
367
368 =head1 SEE ALSO
369
370 L<top(1)>,
371 L<virsh(1)>,
372 L<xm(1)>,
373 L<xentop(1)>,
374 L<http://www.libvirt.org/ocaml/>,
375 L<http://www.libvirt.org/>,
376 L<http://et.redhat.com/~rjones/>,
377 L<http://caml.inria.fr/>
378
379 =head1 AUTHORS
380
381 Richard W.M. Jones <rjones @ redhat . com>
382
383 =head1 COPYRIGHT
384
385 (C) Copyright 2007 Red Hat Inc., Richard W.M. Jones
386 http://libvirt.org/
387
388 This program is free software; you can redistribute it and/or modify
389 it under the terms of the GNU General Public License as published by
390 the Free Software Foundation; either version 2 of the License, or
391 (at your option) any later version.
392
393 This program is distributed in the hope that it will be useful,
394 but WITHOUT ANY WARRANTY; without even the implied warranty of
395 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
396 GNU General Public License for more details.
397
398 You should have received a copy of the GNU General Public License
399 along with this program; if not, write to the Free Software
400 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
401
402 =head1 REPORTING BUGS
403
404 Bugs can be viewed on the Red Hat Bugzilla page:
405 L<https://bugzilla.redhat.com/>.
406
407 If you find a bug in virt-top, please follow these steps to report it:
408
409 =over 4
410
411 =item 1. Check for existing bug reports
412
413 Go to L<https://bugzilla.redhat.com/> and search for similar bugs.
414 Someone may already have reported the same bug, and they may even
415 have fixed it.
416
417 =item 2. Capture debug and error messages
418
419 Run
420
421  virt-top --debug virt-top.log
422
423 and keep I<virt-top.log>.  It contains error messages which you
424 should submit with your bug report.
425
426 =item 3. Get version of virt-top and version of libvirt.
427
428 In virt-top, press the I<h> (help) key, and write down the version of
429 virt-top and the version of libvirt.  They are shown in the first
430 line.
431
432 =item 4. Submit a bug report.
433
434 Go to L<https://bugzilla.redhat.com/> and enter a new bug.
435 Please describe the problem in as much detail as possible.
436
437 Remember to include the version numbers (step 3) and the debug
438 messages file (step 2).
439
440 =item 5. Assign the bug to rjones @ redhat.com
441
442 Assign or reassign the bug to B<rjones @ redhat.com> (without the
443 spaces).  You can also send me an email with the bug number if you
444 want a faster response.
445
446 =back
447
448 =end