powershellscripts.com

Tutorials  PowerShell Cmdlet Help for Get-Stat



NAME
Get-Stat

SYNOPSIS
Retrieves the statistical information available on a vSphere server.

SYNTAX
Get-Stat [-Entity] [-Common] [-Memory] [-Cpu] [-Disk] [-Network] [-Stat ] [-Start
] [-Finish ] [-MaxSamples ] [-IntervalMins ] [-IntervalSecs ] [-Instance ]
[-Realtime] [-Server ] []


DESCRIPTION
Retrieves the statistical information available on a vSphere server for each provided entity. For example, if the C
PU parameter is set to $true, collects the average CPU usage and the average CPU usagemhz counters as appropriate f
or each entity. If the Stats parameter is set to $true, collects all provided named stats counters. Counters are pr
ovided using a dotted notation of the form "counter group"."counter name"."rollup type". For example: "cpu.usage.mi
n". The cmdlet uses the Start time, if provided, and the Finish time, if provided, along with the MaxSamples, if pr
ovided, to bound the data collection. If intervalSecs is provided, the closest matching available interval is used
. For each statistics sample on the server, the cmdlet returns a Sample object. The Instance property of the Sample
object shows the serial number of the device for which a statistics value is taken. If the Instance property is em
pty ("), this indicates that the statistics sample contains an average statistic value for all specified devices. I
f you are connected to a vCenter Server and Get-Stat is run for a host entity, the cmdlet returns only the statisti
cs available on the vCenter Server.


PARAMETERS
-Entity
Specify the objects (such as virtual machine, virtual machine host, resource pool, and so on) whose statistics
you want to retrieve.

Required? true
Position? 1
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? true

-Common
Indicate whether the command collects common CPU, disk, memory and network statistics.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-Memory
Indicate whether the command collects common memory statistics, such as the mem usage, mem vmmemctl, mem active
and mem granted counters as appropriate for each entity.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-Cpu
Indicate whether the command collects common CPU statistics, such as the average CPU usage and average CPU usag
emhz counters as appropriate for each entity.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-Disk
Indicate whether the command collects common disk statistics, such as the average disk usage, average disk read
and average disk write counters as appropriate for each entity.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-Network
Indicate whether the command collects common network statistics, such as the average network usage, average net
work transmitted and average network received counters as appropriate for each entity.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-Stat
Specify the identifiers of the statistics you want to retrieve. Counters are provided using a dotted notation o
f the form "counter group"."counter name"."rollup type". For example, "cpu.usage.min".

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? true

-Start
Specify the beginning of the time range for which you want to collect statistics. The valid format is dd/mm/yyy
y.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-Finish
Specify the end of the time range for which you want to collect statistics. The valid format is dd/mm/yyyy.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-MaxSamples
Specify the maximum number of samples for each statistic.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-IntervalMins
This parameter is deprecated and scheduled for removal. Specify the interval in minutes of the statistics sampl
es you want to retrieve. The closest available statistics interval is taken. If the IntervalMins parameter is n
ot specified, the samples with the best sample rate are retrieved. A best sample rate is the highest sample rat
e, whose relevant period contains the relevant periods for all other sample rates. A relevant period is the per
iod that starts no earlier than the oldest sample still retained, and is a subset of a query period specified b
y the user.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-IntervalSecs
Specify the interval in seconds of the statistics samples you want to retrieve. The closest available statistic
s interval is taken.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-Instance
Specify the Instance property of the statistics you want to retrieve.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-Realtime
Indicate whether the command collects real time statistics.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-Server
Specify the vSphere servers on which you want to run the cmdlet. If no value is given to this parameter, the co
mmand runs on the default servers. For more information about default servers, see the description of Connect-V
IServer.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? true


This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer and OutVariable. For more information, type,
"get-help about_commonparameters".

INPUTS



OUTPUTS
Sample


NOTES


Samples are not generated for a virtual machine while it is powered off.

-------------- Example 1 --------------

C:\PS>Get-Stat -Entity VM -Start 5/5/2008 -Finish 7/10/2008 -Disk -IntervalSecs 300


Prints the disk statistics for the specified time interval for the first virtual machine, retrieved by the Get-VM c
mdlet.





-------------- Example 2 --------------

C:\PS>Get-Stat -Entity Host -Cpu -Instance 0, "


Retrieves the cumulative statistics for a multiprocessor host and the CPU statistics for the first processor.






RELATED LINKS
Online version: http://www.vmware.com/support/developer/PowerCLI/PowerCLI501/html/Get-Stat.html
Get-StatType
Get-StatsInterval
New-StatsInterval
Remove-StatsInterval
Set-StatsInterval