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

Thank you once again

 

The question which i have does it give output for average active memory for the virtual machines?

 

 

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

 

 

It really worked and i have changed the memory usuage to mem.active.average. It gives me data for each day for one month, i need a report complete average report of CPU&memory report for one month, not on daily basis for one month.


Viewing all articles
Browse latest Browse all 46

Trending Articles



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