ESXi 5.1 Host CPU and Memory Summary From Cli

Can you display the current CPU and memory usage on a host via the Cli. I have noticed sometime the GUI is slow to refresh and wanted to see if the Cli would provide more accurate information faster.
LVL 21
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

What you need is a script to do this. We've used a .ps1 script which utilizes a PS command line to execute and get live stats on memory/cpu usage.

Hopefully the following Vmware post will be what you're looking for.
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
Yes, you can use esxtop on the host (at console or via SSH) or resxtop (via vMA)

or if you mean  a one liner Power CLI


 Get-Stat -Entity VMname -Memory -Realtime

Open in new window


 Get-Stat -Entity VMname -CPU -Realtime

Open in new window

Your reference is here to the Get-Stat command

You can use different metrics, realtime, intervals, start and stop times, information is retrieved from vCenter Db.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
compdigit44Author Commented:
Thank you hancock.... so you can use Powercli to get the realtime stats of a VM and not the host???? Why  is this Oh great one... LOL :-)
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
So you want the CPU and Memory of the host, not the VMs on a host ?

 esxtop on the host (at console or via SSH) or resxtop (via vMA)

or event simplier, a single command


Open in new window


 get-vmhost | fl

Open in new window

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.