A statistic key identifies a vRealize Operations Manager metric. The Get-OMStatKey
cmdlet retrieves vRealize Operations Manager statistic keys. The syntax of the Get-OMStatKey
cmdlet is given here. The first parameter set is the default:
Get-OMStatKey [[-Name] <String[]>] [-ResourceKind
<String[]>] [-AdapterKind <String[]>] [-Server <OMServer[]>]
[<CommonParameters>]
The second parameter set is required to retrieve statistic keys by resource:
Get-OMStatKey [[-Name] <String[]>] -Resource
<OMResource[]> [-Server <OMServer[]>] [<CommonParameters>]
The -Resource
parameter is required.
The Get-OMStatKey
cmdlet without parameters returns all of the statistic keys. There are too many statistic keys to shows in this book. Piping the output of the Get-OMStatKey
cmdlet to the Measure-Object
cmdlet and displaying the Count
property shows us the number of statistic keys, as in the following command:
PowerCLI C:> (Get-OMStatKey | Measure-Object).Count
In my lab environment, the output of the preceding command is as follows:
24078
To show you the properties of a statistics key object, we will retrieve the statistic keys, select only the first one, and format the output in a list view using the following command:
PowerCLI C:> Get-OMStatKey | Select-Object -First 1 | Format-List
The preceding command has the following output:
ExtensionData : VMware.VimAutomation.VROps.Views.ResourceTypeAttribu te Name : badge|stress_whatif Unit : % Description : Stress with committed projects ResourceKind : BusinessService AdapterKind : Container Client : VMware.VimAutomation.vROps.Impl.V1.OMClientImpl Uid : /[email protected]:443/AdapterKind=Contain er/ResourceKind=BusinessService/OMStatKey=badge|stre ss_whatif/
3.17.75.227