Jinto,
The usage comments are in the file. I’ll copy paste them here (getClusterStats.ps1):
# This script retrieves Performance metrics from a given vCenter cluster
# To use this script you need to pass in the following parameters:
# 0, the halt on error flag setting, if this is set to stop the script
# will stop on errors reported back by the powershell api
# 1, name of the vCenter Server
# 2, name of the vCenter cluster
# 3, counterId: The stat counterId to be passed in to the PerfQuerySpec; -1 to list all available counterIds
#
Here’s an example:
C:\> powershell .\getClusterStats.ps1 stop 2
Here, I pass the “stop” parameter to tell powershell to stop if it encounters an error.
The last parameter (2) is the counterId that represents “cpu.usage.average [rate,percent])”.
The result I get is a chart that contains the cpu.usage.average of all hosts in the specified cluster from my vcenter server.
Please read the “Instructions” tab of this fling to understand the rest of the options that you can use with this script.
Hope that helps!