Added --script option.
[virt-top.git] / virt-top / virt-top.txt
1 NAME
2     virt-top - 'top'-like utility for virtualization stats
3
4 SUMMARY
5     virt-top [-options]
6
7 DESCRIPTION
8     virt-top is a top(1)-like utility for showing stats of virtualized
9     domains. Many keys and command line options are the same as for ordinary
10     *top*.
11
12     It uses libvirt so it is capable of showing stats across a variety of
13     different virtualization systems.
14
15 OPTIONS
16     -1  Display physical CPUs by default (instead of domains). When virt-top
17         is running, use the *1* key to toggle between physical CPUs and
18         domains display.
19
20     -2  Display network interfaces by default (instead of domains). When
21         virt-top is running, use the *2* key to toggle between network
22         interfaces and domains display.
23
24     -3  Display block devices (virtual disks) by default (instead of
25         domains). When virt-top is running, use the *3* key to toggle
26         between block devices and domains display.
27
28     -b  Batch mode. In this mode keypresses are ignored.
29
30     -c uri or --connect uri
31         Connect to URI given. The default is to connect to the Xen
32         hypervisor.
33
34     -d delay
35         Set the delay between screen updates in seconds. The default is 3.0
36         seconds. You can change this while virt-top is running by pressing
37         either *s* or *d* key.
38
39     -n iterations
40         Set the number of iterations to run. The default is to run
41         continuously.
42
43     -o sort
44         Set the sort order to one of: cpu (sort by %CPU used), mem (sort by
45         memory used), time (sort by total time), id (sort by domain ID),
46         name (sort by domain name), netrx (sort by network received bytes),
47         nettx (sort by network transmitted bytes), blockrdrq (sort by block
48         device [disk] read requests), blockwrrq (sort by block device [disk]
49         write requests).
50
51         While virt-top is running you can change the sort order using keys
52         *P* (cpu), *M* (memory), *T* (total time), *N* (domain ID), *F*
53         (interactively select the sort field).
54
55     -s  Secure mode. Currently this does nothing.
56
57     --hist-cpu secs
58         Set the time in seconds between updates of the historical %CPU at
59         the top right of the display.
60
61     --csv file.csv
62         Write the statistics to file *file.csv*. First a header is written
63         showing the statistics being recorded in each column, then one line
64         is written for each screen update. The CSV file can be loaded
65         directly by most spreadsheet programs.
66
67         Currently the statistics which this records vary between releases of
68         virt-top (but the column headers will stay the same, so you can use
69         those to process the CSV file).
70
71         Not every version of virt-top supports CSV output - it depends how
72         the program was compiled (see *README* file in the source
73         distribution for details).
74
75     --debug filename
76         Send debug and error messages to *filename*. To send error messages
77         to syslog you can do:
78
79          virt-top --debug >(logger -t virt-top)
80
81         See also REPORTING BUGS below.
82
83     --init-file filename
84         Read *filename* as the init file instead of the default which is
85         *$HOME/.virt-toprc*. See also INIT FILE below.
86
87     --no-init-file
88         Do not read any init file.
89
90     --script
91         Script mode. There will be no user interface. This is most useful
92         when used together with the *--csv* and *-n* options.
93
94     --help
95         Display usage summary.
96
97 KEYS
98     Note that keys are case sensitive. For example use upper-case *P* (shift
99     P) to sort by %CPU. *^* before a key means a Ctrl key, so *^L* is Ctrl
100     L.
101
102     *space* or *^L*
103         Updates the display.
104
105     *q* Quits the program.
106
107     *h* Displays help.
108
109     *s* or *d*
110         Change the delay between screen updates.
111
112     *0* (number 0)
113         Show the normal list of domains display.
114
115     *1* (number 1)
116         Toggle into showing physical CPUs. If pressed again toggles back to
117         showing domains (the normal display).
118
119     *2* Toggle into showing network interfaces. If pressed again toggles
120         back to showing domains.
121
122     *3* Toggle into showing block devices (virtual disks). If pressed again
123         toggles back to showing domains.
124
125     *P* Sort by %CPU.
126
127     *M* Sort by memory.
128
129     *T* Sort by total time.
130
131     *N* Sort by domain ID.
132
133     *F* Select the sort field interactively (there are other sort fields you
134         can choose using this key).
135
136     *W* This creates or overwrites the init file with the current settings.
137
138         This key is disabled if *--no-init-file* was specified on the
139         command line or if *overwrite-init-file false* is given in the init
140         file.
141
142 INIT FILE
143     When virt-top starts up, it reads initial settings from the file
144     *.virt-toprc* in the user's home directory.
145
146     The name of this file may be overridden using the *--init-file filename*
147     command line option or may be disabled entirely using *--no-init-file*.
148
149     The init file has a simple format. Blank lines and comments beginning
150     with *#* are ignored. Everything else is a set of *key value* pairs,
151     described below.
152
153     display *task|pcpu|block|net*
154         Sets the major display mode to one of *task* (tasks, the default),
155         *pcpu* (physical CPUs), *block* (block devices), or *net* (network
156         interfaces).
157
158     delay *secs*
159         Sets the delay between display updates in seconds.
160
161     hist-cpu *secs*
162         Sets the historical CPU delay in seconds.
163
164     iterations *n*
165         Sets the number of iterations to run before we exit. Setting this to
166         *-1* means to run continuously.
167
168     sort *cpu|mem|time|id|name|...*
169         Sets the sort order. The option names are the same as for the
170         command line *-o* option.
171
172     connect *uri*
173         Sets the default connection URI.
174
175     debug *filename*
176         Sets the default filename to use for debug and error messages.
177
178     csv *filename*
179         Enables CSV output to the named file.
180
181     batch *true|false*
182         Sets batch mode.
183
184     secure *true|false*
185         Sets secure mode.
186
187     script *true|false*
188         Sets script mode.
189
190     overwrite-init-file *false*
191         If set to *false* then the *W* key will not overwrite the init file.
192
193     Note that in the current implementation, options specified in the init
194     file override options specified on the command line. This is a bug and
195     this behaviour may change in the future.
196
197 SEE ALSO
198     top(1), virsh(1), xm(1), xentop(1), <http://www.libvirt.org/>,
199     <http://et.redhat.com/~rjones/>, <http://caml.inria.fr/>
200
201 AUTHORS
202     Richard W.M. Jones <rjones @ redhat . com>
203
204 REPORTING BUGS
205     Bugs can be viewed on the Red Hat Bugzilla page:
206     <https://bugzilla.redhat.com/>.
207
208     If you find a bug in virt-top, please follow these steps to report it:
209
210     1. Check for existing bug reports
211         Go to <https://bugzilla.redhat.com/> and search for similar bugs.
212         Someone may already have reported the same bug, and they may even
213         have fixed it.
214
215     2. Capture debug and error messages
216         Run
217
218          virt-top --debug virt-top.log
219
220         and keep *virt-top.log*. It contains error messages which you should
221         submit with your bug report.
222
223     3. Get version of virt-top and version of libvirt.
224         In virt-top, press the *h* (help) key, and write down the version of
225         virt-top and the version of libvirt. They are shown in the first
226         line.
227
228     4. Submit a bug report.
229         Go to <https://bugzilla.redhat.com/> and enter a new bug. Please
230         describe the problem in as much detail as possible.
231
232         Remember to include the version numbers (step 3) and the debug
233         messages file (step 2).
234
235     5. Assign the bug to rjones @ redhat.com
236         Assign or reassign the bug to rjones @ redhat.com (without the
237         spaces). You can also send me an email with the bug number if you
238         want a faster response.
239