I noticed that even there is a quite a lot of documentation about esxtop or resxtop many users still have a problems with running esxtop in batch mode or with customize performance metrics. So I thought it would be good idea to blog out, step by step tutorial.
You can run esxtop on ESX directly, so no problem with that but if you would like to run resxtop against ESXi you have to use vMA (vSphere Management Assistance), it’s a virtual appliance which you can download from VMware download pages with all necessary documentation.
How to start esxtop or resxtop in a batch mode with customize configuration file ? By default esxtop or resxtop are loaded with default set of metrics. If you would run esxtop in a batch mode for a log time e.g 24h, your csv file would be very big and would contain a lot of data which in general it might not be useful during troubleshoot or for later analysis. If you wanna limit some gathered metrics during batch mode follow below steps:
- Start esxtop or resxtop
- Type h , screen with help will appear, you will see all possible switch which can be used in interactive mode.
- To switch between different set of metrics use key from Switch display section.
- E.g one wants to monitor Memory metrics – type m, you will see esxtop with a memory metrics
- If one wants to see list of metrics which are available and currently monitored type F or f, * next to metrics indicates that metrics is currently monitored
- To exclude metrics from current view type letter which is next to desire metric.
- Once you do your selection on e.g Memory metrics, use switches from Switch display (first printscreen) to see different type of metrics.
- Finally when you done with your metrics, you have it selected what you need, in order to use your selected metrics in a batch mode configuration has to be saved to new configuration file, type W and specify path for new esxtop or resxtop configuration file, e.g. /root/batch_mode
- Quit from esxtop or resxtop (q)
- Start esxtop or resxtop in a batch mode, e.g.
- esxtop -b -c /root/batch_mode -d 60 -n 60 > /root/batch_mode.csv
- resxtop -b -c /root/barch_mode -d 60 -n 60 -server (ESXi server name) -username root > /root/batch_mode.csv
- Explanation to above switches:
- -b — batch mode
- -c — path to custom config file for esxtop or resxtop
- -d — time between samples (in above example 60 seconds)
- -n — how many samples (in above example 60 samples)
- -server — IP or FQDN of your ESXi server
- -username — I think doesn’t need explanation
- > [path for output csv file] — redirection to file
Someone may ask ” what about password switch? ” when using resxtop – you will be asked for by the system.
- When sampling get finish CSV output file can be downloaded and imported to Excel, Windows perfmon or to esxplot. Go to www.yellow-bricks.com/esxtop to find out how to play with output file
Resources:
http://www.vmware.com/pdf/vsphere4/r40_u1/vsp_40_u1_resource_mgmt.pdf
http://www.vmware.com/support/developer/vima/vma41/doc/vma_41_guide.pdf
http://www.yellow-bricks.com/esxtop/
Had to reach out and say thanks. Worked a charm…