top of page
Writer's pictureAbhilash GB

Using PowerCLI to fetch vCenter Performance Statistics

VMware PowerCLI allows viewing performance statistics collected by vCenter on vSphere Datacenters, Clusters, ESXi Hosts, VMs, and datastores. The cmdlet to be used is "Get-Stat."

Get-Stat -Entity <cluster> -Stat 

Running against a vSphere cluster would reveal all available cluster metrics and their current values.



You can also choose to pull statistics corresponding to a specific metric. For example, you could just fetch the memory usage average numbers. To do so, use the corresponding MetricId using the -Stat switch.















You can use PowerShell to further transform the statistics into a desired form - for instance, the memory consumption average for the last seven days. To do so, pass the output of the Get-Stat command to the Measure-Object cmdlet.



Running against a vSphere Host would also reveal a similar set of metrics and values corresponding to ESXi. And much like with the cluster stats, you could filter and extract the metrics/value you are after.



















To list all available metrics for a specific vCenter managed object, run the Get-StatType -Entity "Name of the object"



Comments


bottom of page