Quantcast
Channel: VMware Communities: Message List - need a script to collect the performance report.
Viewing all articles
Browse latest Browse all 46

Re: need a script to collect the performance report.

$
0
0

So just a monthly cpu and memory average, 1 value ech, per VM ?

Then try this

 

 

$vms=Get-VM
$metric
="cpu.usage.average","mem.active.average"
$now
=Get-Date-Hour0-Minute0-Second0
$finish
=$now.AddDays(-$now.Day)$start=$finish.AddMonths(-1).AddDays(1)$finish=$finish.AddDays(1).AddMinutes(-1)Get-Stat-Entity$vms-Stat$metric-Start$start-Finish$finish |
Group-Object-Property {$_.Entity.Name} |Select @{N="VM";E={$_.Values[0]}}, @{N="Time";E={$start}}, @{N="CPU";E={($_.Group | where {$_.MetricId -eq"cpu.usage.average"} | Measure-Object-PropertyValue-Average).Average}}, @{N="Memory";E={($_.Group | where {$_.MetricId -eq"mem.active.average"} | Measure-Object-PropertyValue-Average).Average}} |Export-Csv"C:\stat-report.csv"-NoTypeInformation-UseCulture

Viewing all articles
Browse latest Browse all 46

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>