Bootstrap FreeKB - VMWare - List the amount of memory and CPU used using the esxtop command
VMWare - List the amount of memory and CPU used using the esxtop command

Updated:   |  VMWare articles

At a quick glance, the esxtop command is very similar to the Linux top command, but with some important differences. 

Just like the Linux top command, by default, the exptop command can be used to view processes in real time, meaning that the top output will refresh every few seconds.

[root@server1 ]# esxtop
 7:45:21pm up 3 days 16:29, 503 worlds, 4 VMs, 6 vCPUs; CPU load average: 0.01, 0.01, 0.01
PCPU USED(%): 0.1 0.1 0.6 0.9 0.7 1.2 0.5 1.4 AVG: 0.7
PCPU UTIL(%): 100 0.2 0.4 1.0 0.9 0.6 0.6 1.4 AVG:  13
CORE UTIL(%): 100     0.0     0.5     5.8     AVG:  26

      ID      GID NAME             NWLD   %USED    %RUN    %SYS   %WAIT %VMWAIT    %RDY   %IDLE  %OVRLP   %CSTP  %MLMTD  %SWPWT
   24251    24251 vm1.example.com    10    3.80    3.91    0.02  971.74   18.73    0.10  172.60    0.01    0.00    0.00    0.00
       1        1 system            176    1.29  681.89    0.00 16437.49      -  102.40    0.00    0.41    0.00    0.00    0.00
   26058    26058 vm2.example.com     8    0.64    0.71    0.00  780.91    0.00    0.14  102.77    0.00    0.00    0.00    0.00

 

The -b (batch) and -n (number of interations) and -d (delay) options can be used to get a snapshot of the results (non-interactive).

esxtop -b -n 1 -b 2

 

By default, esxtop will display results for all of the adapters, devices (storage), network interfaces, and virtual machines. Let's say you want to only get the stats of a certain entity, such as a certain virtual machine. Use the following command to create a file that contains all of the entities.

esxtop --export-entities entities.txt

 

The exported file will contain something like this.

48273 vm1.example.com
24251 vm2.example.com

 

Then, to only display the stats for a certain entity, create a different file that contains the entity you want the stats on, and run the following command.

esxtop --import-entity entity.txt

 

In the interactive esxtop, the f option can be used to toggle columns on and off, and then the W option can be used to create a custom configuration file with the columns. Then you can use the custom configuration file when running esxtop.

esxtop -c config.txt

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter 78a8d4 in the box below so that we can be sure you are a human.