VMware Cloud Community
Rogg23
Contributor
Contributor
Jump to solution

Using get-stat to retrieve samples from the past.

Hi,

I am trying to use get-stat to retrieve some data from the past.

I am looking at data for a 90 minute period from the 18th Jan on a specific virtual machine, starting at 11.30am.

Running the following script, I get a value listed every half hour, as I would expect with this script:

get-vm "vmname" | get-stat -stat cpu.usage.average -start (get-date 18/01/2010).addminutes(690) -finish (get-date 18/01/2010).addminutes(780)

cpu.usage.average 18/01/2010 13:00:00 2.61 %

cpu.usage.average 18/01/2010 12:30:00 2.3 %

cpu.usage.average 18/01/2010 12:00:00 2.63 %

cpu.usage.average 18/01/2010 11:30:00 2.28 %

What I want to do is get the samples between these times every 20 seconds, but if I add " -intervalsecs 20 " to the command, I get no output.

What am I doing wrong or what do I need to change?

Thanks.

Roger.

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

That is caused by the Historical Intervals and the data rollup jobs that run on the VC db.

See my PowerCLI & vSphere statistics – Part 1 – The basics post for more info on this.


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

View solution in original post

0 Kudos
2 Replies
LucD
Leadership
Leadership
Jump to solution

That is caused by the Historical Intervals and the data rollup jobs that run on the VC db.

See my PowerCLI & vSphere statistics – Part 1 – The basics post for more info on this.


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

0 Kudos
Rogg23
Contributor
Contributor
Jump to solution

Thanks for the quick response, and the useful information.

0 Kudos