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: