VMware Cloud Community
AWahlert
Contributor
Contributor
Jump to solution

no response from get-stat

Hi List,

i have a strange problem with a performance script:

i want to get the mem.usage.average / cpu.usage.average counters from all my esxi (4.1.1) Servers

connect-ViServer "vcenter.server.local"

$esxHost  = get-vmhost "server.esx.local"

get-stat -entity $esxHost -stat mem.usage.average

...

On seven servers this runs fine. On one Server, i didn't get any response. No data, no exception no failure. simply nothing.

Can anyone help me with this??

kind regards

Andreas

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Ok, that seems to indicate that the performance data is for one reason or the other not being transferred between the host and vCenter.

If possible, can you do a remove/add for the specific host.

You can do this from the vSphere client or use the PowerCLI cmdlets Remove-VMHost and Add-VMHost.

The realtime statistical data is cached on the ESX(i) server for about 1 hour, after that the vCenter aggregation should kick in.

So you should start seeing performance data, from Get-Stat or in the vSphere client, after about 1 hour.

Btw, the guests running on that host will normally not be impacted by the remove/add.


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

View solution in original post

0 Kudos
9 Replies
LucD
Leadership
Leadership
Jump to solution

First question, from where do you run the Get-Stat, from PowerGui or from the PowerCLI prompt ?

On the PowerCLI prompt you should normally see some error messages if there is no data available.


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

0 Kudos
LucD
Leadership
Leadership
Jump to solution

Does the following return anything on that specific server ?

Get-Stat -Entity $esx -Stat mem.usage.average -Realtime


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

0 Kudos
AWahlert
Contributor
Contributor
Jump to solution

Hi,

the "metric Switch throws an error. But with the "-stat " AND the "realtime" switch i get data from the last hour.

I'm doing this in the PowerCli (32 Bit / 64 Bit Win 7, both gives the same result)

Thx

Andreas

0 Kudos
LucD
Leadership
Leadership
Jump to solution

The Metric switch was a typo, that should have been Stat.

But the fact that the Realtime switch returns data, means the performance data is captured on the ESX(i) server.

Now let's take the next step and see if the data is aggregated on the vCenter server.

Does

Get-Stat -Entity $esx -Stat mem.usage.average -IntervalSecs 300

return any data ?

This should return data from Historical Interval 1.


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

0 Kudos
AWahlert
Contributor
Contributor
Jump to solution

Hmm,

this returns "metric counter dosn't exist for entity ..."

Same with the realtime Switch runs fine.

NTP Service is running on the esxi's and the time on the esxi's is the same as on the client and on the vcenter server. (i have this kb.)

But in my vcenter Client in the performance charts from this Host, i see on the "past Day" Tab "no data availeble". The realtime Tab shows  correct Data

Kind regrads

Andreas

0 Kudos
LucD
Leadership
Leadership
Jump to solution

Ok, that seems to indicate that the performance data is for one reason or the other not being transferred between the host and vCenter.

If possible, can you do a remove/add for the specific host.

You can do this from the vSphere client or use the PowerCLI cmdlets Remove-VMHost and Add-VMHost.

The realtime statistical data is cached on the ESX(i) server for about 1 hour, after that the vCenter aggregation should kick in.

So you should start seeing performance data, from Get-Stat or in the vSphere client, after about 1 hour.

Btw, the guests running on that host will normally not be impacted by the remove/add.


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

0 Kudos
AWahlert
Contributor
Contributor
Jump to solution

Ok,  I will try this on Monday Morning  For now  many thanks and a nice Weekend  Kind regards   Andreas

0 Kudos
AWahlert
Contributor
Contributor
Jump to solution

Hi Luc

many thanks, removing and adding the specific host solves my problem.

Only to understand it right:

the esxi host chaches the data for one hour, any other data is transfered to the VCenter, isn'it??

kind regards

Andreas

0 Kudos
LucD
Leadership
Leadership
Jump to solution

That is correct.

You can test this by using the Realtime parameter. It will return all data directly from the ESXi server.

The following will display the first and the last entry from the ESXi cache.

Get-Stat -Entity $vm -Stat cpu.usage.average -Realtime | Sort-Object -Property Timestamp | `
Select -First 1 -Last 1

You should see a time difference between the 2 entries of +/- 1 hour.


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

0 Kudos