VMware Cloud Community
alexander19
Contributor
Contributor

Cluster CPU Usage Average

Hello,

After I have read few topic related to this problem I found this script:

$stat = "cpu.usage.average"

$entity = Get-Cluster

$start = (Get-Date).AddDays(-7)

Get-Stat -Entity $entity -Start $start -Stat $stat |

Group-Object -Property {$_.Entity.Name} |

Select Name,

    @{N="CPU average";E={$_.Group | Measure-Object -Property Value -Average | Select -ExpandProperty Average}}

The problem is that I'm getting only 1 cluster in results and one of Vcenter have 2 cluster and second one 4 clusters.

Get-Cluster  is showing correct numer and name for clusters.

I've already try to modify this code but nothing seems to work. A littel bit of help please?

20 Replies
LucD
Leadership
Leadership

I suggest to ask your question in the vSphere Automation SDK for Python  community.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference