PowerCLI

 View Only
  • 1.  Script to capture Cluster level CPU and memory usage

    Posted Apr 06, 2017 05:36 PM

    HI Guys

    Can someone help me in getting powershell script to capture the report on cluster wise cpu and memory usage for past 6 months   like the attached screen shot



  • 2.  RE: Script to capture Cluster level CPU and memory usage

    Posted Apr 06, 2017 06:14 PM

    Those screenshots turn out to be rather smallish.
    Can you attach a bigger version?



  • 3.  RE: Script to capture Cluster level CPU and memory usage

    Posted Apr 07, 2017 09:41 AM

    Hi Lucd

    Attached the screenshot again



  • 4.  RE: Script to capture Cluster level CPU and memory usage

    Posted Apr 24, 2017 02:32 PM

    Guys any help on this



  • 5.  RE: Script to capture Cluster level CPU and memory usage

    Posted Apr 24, 2017 04:41 PM

    You do something like this.
    Adapt the start date to your requirements.

    Not sure which memory metrics are shown in that 2nd graph. Can you find out?
    In any case, that would be the same code, just with different metrics.

    $clusterName = 'MyCluster'

    $stat = 'cpu.usagemhz.average','cpu.totalmhz.average'

    $start = (Get-Date).AddDays(-14)

    $cluster = Get-Cluster -Name $clusterName

    Get-Stat -Entity $cluster -Stat $stat -Start $start



  • 6.  RE: Script to capture Cluster level CPU and memory usage

    Posted Apr 24, 2017 05:15 PM

    Hi Lucd

    Am getting below error message

    Get-Stat : 24/04/2017 18:12:28    Get-Stat        A specified parameter was not correct.

    querySpec.size

    At line:1 char:9

    + Get-Stat <<<<  -Entity $cluster -Stat $stat -Start $start

        + CategoryInfo          : NotSpecified: (:) [Get-Stat], InvalidArgument

        + FullyQualifiedErrorId : Client20_RuntimeDataServiceImpl_GetStats_ErrorRetreivingPerfMetrics,VMware.VimAutomation.ViCore.Cmdlets.Commands.GetViStats



  • 7.  RE: Script to capture Cluster level CPU and memory usage

    Posted Apr 24, 2017 05:37 PM

    That's most probably the issue described in KB2107096