ehsanijavad
Enthusiast
Enthusiast

get-state > last day

Jump to solution

Hi all

I need your help, someone know why I see the not real number for last day. (for all metric I see double). for others (real time and last week and last month) are correct.

ehsanijavad_0-1614670630504.png

 

ehsanijavad_1-1614670647180.png

ehsanijavad_2-1614670741365.png

 

Thanks in advance for your help.

 

Regards

Jawad

 

0 Kudos
2 Solutions

Accepted Solutions
LucD
Leadership
Leadership

Yes, I tried several days from last week, and all are showing the same as the Web Client.

An SR is a Support Request.
See How to File a Support Request


Which performance metrics to report on depends primarily on what you want to see in your report.
In the Introduction section in my PowerCLI & vSphere statistics – Part 1 – The basics post I list some documents that might help determining what to report on.


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

View solution in original post

0 Kudos
ehsanijavad
Enthusiast
Enthusiast
0 Kudos
6 Replies
LucD
Leadership
Leadership

In my test environment (vSphere 7u1), the value I get from Get-Stat and the value I see in the Web Client correspond.
Unfortunately, you didn't include the full code that generates that output you show, so I can't really verify.

PS: please don't use screenshots for showing code, I'm not really going to type in your code from a screenshot.


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

0 Kudos
ehsanijavad
Enthusiast
Enthusiast

Hi LucD

Thanks for your response.

$vm = get-vm xxxxx*

$output=@()

for ($i=0 ; $i -lt 4 ; $i++) {

if ($i -eq 0) {
$divider=200
$Ready = “{0:n2}” -f ((Get-Stat -Entity $vm -Stat cpu.ready.summation -Realtime -instance "" -ea SilentlyContinue | measure Value -Average).Average)
$usage = (Get-Stat -Entity $vm -Stat cpu.usage.average -Realtime -instance "" -ea SilentlyContinue | measure Value -Average).Average
$CoStop = (Get-Stat -Entity $vm -Stat cpu.costop.summation -Realtime -instance "" -ea SilentlyContinue | measure Value -Average).Average

}

if ($i -eq 1) {
$divider=3000
$Ready = “{0:n2}” -f ((Get-Stat -Entity $vm -Stat cpu.ready.summation -start (get-date).adddays(-1) -finish (get-date) -interval (5) -instance "" -ea silentlycontinue | measure Value -Average).Average)
$usage = (Get-Stat -Entity $vm -Stat cpu.usage.average -start (get-date).adddays(-1) -finish (get-date) -interval (5) -instance "" -ea silentlycontinue | measure Value -Average).Average
$CoStop = (Get-Stat -Entity $vm -Stat cpu.costop.summation -start (get-date).adddays(-1) -finish (get-date) -interval (5) -instance "" -ea silentlycontinue | measure Value -Average).Average
}

if ($i -eq 2) {
$divider=18000
$Ready = “{0:n2}” -f ((Get-Stat -Entity $vm -Stat cpu.ready.summation -start (get-date).adddays(-7) -finish (get-date) -interval (30) -instance "" -ea silentlycontinue | measure Value -Average).Average)
$usage = (Get-Stat -Entity $vm -Stat cpu.usage.average -start (get-date).adddays(-7) -finish (get-date) -interval (30) -instance "" -ea silentlycontinue | measure Value -Average).Average
$CoStop = (Get-Stat -Entity $vm -Stat cpu.costop.summation -start (get-date).adddays(-7) -finish (get-date) -interval (30) -instance "" -ea silentlycontinue | measure Value -Average).Average
}

if ($i -eq 3) {
$divider=72000
$Ready = “{0:n2}” -f ((Get-Stat -Entity $vm -Stat cpu.ready.summation -start (get-date).adddays(-30) -finish (get-date) -interval (120) -instance "" -ea silentlycontinue | measure Value -Average).Average)
$usage = (Get-Stat -Entity $vm -Stat cpu.usage.average -start (get-date).adddays(-30) -finish (get-date) -interval (120) -instance "" -ea silentlycontinue | measure Value -Average).Average
$CoStop = 'None'
}

$output += New-Object PSObject -Property @{

VM = ($vm.Name).Split('.')[0]

ReadyAvg = $Ready

Divider = $divider

Interval = &{
if ($divider -eq 200) {'Realtime'}
elseif ($divider -eq 3000) {'1day - 5min'}
elseif ($divider -eq 6000) {'1day - 10min'}
elseif ($divider -eq 9000) {'1day - 15min'}
elseif ($divider -eq 18000) {'7day - 30min'}
elseif ($divider -eq 72000) {'30day - 120min'}

}

Ready = &{ ”{0:n2}” -f ($Ready/$divider)}

Usage = &{ ”{0:n2}” -f $usage}

CoStop = &{ ”{0:n2}” -f $CoStop}

Counter = $i
}

}
$output | select VM, Interval, Ready, ReadyAvg, Divider, Counter, Usage, CoStop | ft -AutoSize

0 Kudos
LucD
Leadership
Leadership

I just tested your script, and for me all the data it returns corresponds exactly with what the Web Client is showing.

This might be an issue with the aggregation jobs running on the VCSA.
Do you see the same discrepancy over multiple days?
I mean, do the results for Past Day are also incorrect when you ran this a couple of days ago or tomorrow?

I would suggest opening an SR.

And despite what GSS might claim, you do not need a Developer or SDK Support contract for PowerCLI related SRs.
Point them to PowerCLI Support Breakdown


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

0 Kudos
ehsanijavad
Enthusiast
Enthusiast

Thanks LucD

I have tried more than 6 days.

Do the results for Past Day are also incorrect when you ran this a couple of days ago or tomorrow?

  • Today it returns corresponds exactly with what the Web Client is showing.

I would suggest opening an SR.

  • SR?

I am confused, because some time real time also returns  don't correspond what the Web Client is showing (show me the double).

for Last week and month is ok.

Do you have any suggestion for report the main factors of (CPU, RAM, Disk and network)?

Thank you in advance for your help.

0 Kudos
LucD
Leadership
Leadership

Yes, I tried several days from last week, and all are showing the same as the Web Client.

An SR is a Support Request.
See How to File a Support Request


Which performance metrics to report on depends primarily on what you want to see in your report.
In the Introduction section in my PowerCLI & vSphere statistics – Part 1 – The basics post I list some documents that might help determining what to report on.


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

0 Kudos
ehsanijavad
Enthusiast
Enthusiast

Thanks LucD.

0 Kudos