limiting output of esxtop in batch mode

6,764

just found this

http://www.r71.nl/kb/technical/290-resxtop-how-to-reduce-output

It doesn't have all the control I'd want, but it's a definite step in the right direction:

  1. Enter ESXTOP in interactive mode on the Service Console by simply typing esxtop at the # prompt
  2. Switch to a component you are NOT interested in capturing statistics on by pressing the corresponding menu option (c: ESX cpu, m: ESX memory, d: ESX disk adapter, u: ESX disk device, v: ESX disk VM).
  3. Press f when viewing the component you do not want to capture. A list of fields will be displayed. You can toggle the fields on and off by pressing the letter corresponding to each field. An * indicates that the field is on. You want to turn off all of the fields you don’t want to collect.
  4. Repeat steps 2 & 3 for the remaining components, leaving only what you want to capture
  5. Switch to the component you want to capture in batch mode and repeat step #3, except you will now enable what you want to capture.
  6. Press W (capital W – case sensitive) to write out the ESXTOP configuration file. You can accept the default or create new configuration files. You may want to create a CPU-only config file, memory-only, and so forth.
  7. Press CTRL+C to stop ESXTOP.
  8. Now, invoke ESXTOP in batch mode, calling your updated or new configuration file you created in step #6 using the -c switch. Here’s an example:# esxtop -b -d 30 -n 480 -c .esxtopcpustats > /tmp/esxtop_cpu_stats.csv where .esxtopcpustats is an ESXTOP config file with only CPU stats. -d sets your capture interval to 30 seconds, and -n sets the number of samples to 480 (or 4 hours with a delay of 30 seconds).
Share:
6,764
Kyle Hailey
Author by

Kyle Hailey

Updated on September 18, 2022

Comments

  • Kyle Hailey
    Kyle Hailey almost 2 years

    is there anyway to limit the output from esxtop in batch mode? I tried running it in batch mode and got 16,000 columns! I could filter this out post collection but at that kind of data volumn it seems like I'd be wasting resources. The interactive output from esxtop is fairly customizable. Here is a pretty good discussion of esxtop http://www.yellow-bricks.com/esxtop/ If the batch mode is not, then I will probably see about parsing the interactive output progamatically. Another option would be using the SKD from VMware but I haven't found any practical examples. I'm doing the collection from opensolaris. There is a perl SDK for LINUX and Windows but I'd rather do everything from opensolaris if possible.

    • Kyle Hailey
      Kyle Hailey almost 13 years
      current ideas is to use ssh and expect and capture the 4 basic esxtop interactive modes direct to a local file and parse that file - seems a bit hacky but seems like the most efficacious considering I see no controls for the esxtop batch mode and trying to search for info on the SDK/api is like entering some alice and wonderland rabbit hole
    • Kyle Hailey
      Kyle Hailey almost 13 years
      another option looks to be using ssh and vsish - investigating