Quick and simple VMware ESX Host Statistics
Just a small oneliner to display all the servers, their overall status, CPU and Memory usage in all your Datacenters (can be handy if you have multiple datacenters).
Get-Datacenter | Sort | Get-VMHost | Sort | Get-View |` Select Name, OverallStatus, ` @{N="CPU Usage (GHz)";E={[math]::round( $_.Summary.QuickStats.OverallCpuUsage/1024,2)}}, ` @{N="Memory Usage (GB)";E={[math]::round( $_.Summary.QuickStats.OverallMemoryUsage/1024,2)}}
And it will give you an output that looks like this:
You may not find it very useful like this, but you can also add a Where statement to this line to filter on several things. For example, you can decide you only want to see the servers that have yellow or red Overall Status due to high memory or CPU usage:
Get-Datacenter | Sort | Get-VMHost | Sort | Get-View | ` Select Name, OverallStatus, ` @{N="CPU Usage (GHz)";E={[math]::round( $_.Summary.QuickStats.OverallCpuUsage/1024,2)}}, ` @{N="Memory Usage (GB)";E={[math]::round( $_.Summary.QuickStats.OverallMemoryUsage/1024,2)}} | ` Where { $_.OverallStatus -ne "green" }
Which will give you something like this:
Ofcourse these onliners are cool and handy to use, but you can also use these oneliners to write a script around it to monitor your servers. I will post a script like that soon to show you different interpretations of this script.

