Exporting esxtop performance data as a CSV file and manipulating it from the command-line
search cancel

Exporting esxtop performance data as a CSV file and manipulating it from the command-line


Article ID: 326309


Updated On:


VMware vSphere ESXi


esxtop is a command line tool for viewing real-time performance data. It is easier to review this data in a graph or look at data in larger chunks.


VMware ESXi 4.1.x Embedded
VMware ESX Server 3.0.x
VMware ESXi 4.0.x Embedded
VMware vSphere ESXi 5.5
VMware vSphere ESXi 5.1
VMware vSphere ESXi 6.0
VMware ESXi 3.5.x Installable
VMware vSphere ESXi 6.5
VMware ESX Server 3.5.x
VMware ESX 4.0.x
VMware ESX 4.1.x
VMware vSphere ESXi 6.7
VMware ESXi 4.0.x Installable
VMware ESXi 3.5.x Embedded
VMware vSphere ESXi 5.0
VMware ESXi 4.1.x Installable


The esxtop utility available in ESX/ESXi 3.x and later versions supports the redirection of its output to a CSV formatted file. This file can be read by Microsoft Windows Performance Monitor (perfmon.exe).
To redirect the output to a file, you must use the esxtop command. For example:
#esxtop > /tmp/perf.csv

If you have connected to ESX/ESXi using vMA, you must use the resxtop command. For example:

# resxtop > /tmp/perf.csv
This command creates a properly formatted CSV file with all the esxtop data. This redirection works with esxtop, usually, in batch mode and also when replaying snapshots from a vm-support.
Note: The ESX/ESXi host does not provide all the commands you need for this procedure. You must upload/transfer the .csv file to any Linux machine.
The esxtop utility creates huge amount of data. Some hosts have reported up to 120,000 columns.
To pull out specific columns of data, run the below command on the Linux machine:
# cat filename | cut -d "," -f 1,`head -1 filename | tr "," "\12" | egrep -n "regex" | cut -d ":" -f 1 | tr "\12" "," | sed "s/,$//"` | head
Where filename is the filename of the CSV data and regex is a regular expression that matches your column names.

To get a complete list of all column names, run this command:

#head -1 filename | tr "," "\12" | less
Note: This list may have thousands of lines.
For example, if you have a CSV file named test.csv :
# cat test.csv | cut -d "," -f 1,`head -1 test.csv | tr "," "\12" | egrep -n "Machine MBytes" | cut -d ":" -f 1 | tr "\12" ","`

"(PDH-CSV 4.0) (EDT)(0)","\\host\\Memory\MachineMBytes"
"04/17/2008 14:23:07","2047"
"04/17/2008 14:23:12","2047"
"04/17/2008 14:23:17","2047"
"04/17/2008 14:23:22","2047"
"04/17/2008 14:23:27","2047"
Note: For a list of available counters, look at the top of the CSV file that was generated. The list may vary for different versions of ESX/ESXi.
For related information on using esxtop for troubleshooting performance issues, see:

Additional Information

For translated versions of this article, see: