PowerCLI

 View Only
  • 1.  Using get-stat to retrieve samples from the past.

    Posted Jan 20, 2010 01:46 PM

    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.



  • 2.  RE: Using get-stat to retrieve samples from the past.
    Best Answer

    Posted Jan 20, 2010 01:49 PM

    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.



  • 3.  RE: Using get-stat to retrieve samples from the past.

    Posted Jan 20, 2010 01:57 PM

    Thanks for the quick response, and the useful information.