Send-LMPushMetric
Syntax
Create-DatasourceName
Send-LMPushMetric [-NewResourceHostName <String>] [-NewResourceDescription <String>] -ResourceIds <Hashtable> [-ResourceProperties <Hashtable>] -DatasourceName <String> [-DatasourceDisplayName <String>] [-DatasourceGroup <String>] -Instances <System.Collections.Generic.List`1[System.Object]> [-ProgressAction <ActionPreference>] [<CommonParameters>]
Create-DatasourceId
Send-LMPushMetric [-NewResourceHostName <String>] [-NewResourceDescription <String>] -ResourceIds <Hashtable> [-ResourceProperties <Hashtable>] -DatasourceId <String> [-DatasourceDisplayName <String>] [-DatasourceGroup <String>] -Instances <System.Collections.Generic.List`1[System.Object]> [-ProgressAction <ActionPreference>] [<CommonParameters>]
Description
The Send-LMPushMetric function sends a push metric to LogicMonitor. It allows you to create a new resource or update an existing resource with the specified metric data.
Examples
Example 1
Send-LMPushMetric -NewResourceHostName "NewResource" -NewResourceDescription "New Resource Description" -ResourceIds @{"system.deviceId"="12345"} -ResourceProperties @{"Property1"="Value1"} -DatasourceId "123" -Instances $InstancesCreates a new resource and sends metric data for the specified instances.
Parameters
-NewResourceHostName
Specifies the hostname of the new resource to be created. This parameter is required if you want to create a new resource.
Type: StringParameter Sets: (All)Aliases:
Required: FalsePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False
-NewResourceDescription
Specifies the description of the new resource to be created. This parameter is required if you want to create a new resource.
Type: StringParameter Sets: (All)Aliases:
Required: FalsePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False
-ResourceIds
Specifies the resource IDs to use for resource mapping. This parameter is mandatory.
Type: HashtableParameter Sets: (All)Aliases:
Required: TruePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False
-ResourceProperties
Specifies the properties of the resources to be updated. This parameter is optional.
Type: HashtableParameter Sets: (All)Aliases:
Required: FalsePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False
-DatasourceId
Specifies the ID of the datasource. This parameter is required if the datasource name is not specified.
Type: StringParameter Sets: Create-DatasourceIdAliases:
Required: TruePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False
-DatasourceName
Specifies the name of the datasource. This parameter is required if the datasource ID is not specified.
Type: StringParameter Sets: Create-DatasourceNameAliases:
Required: TruePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False
-DatasourceDisplayName
Specifies the display name of the datasource. This parameter is optional and defaults to the datasource name if not specified.
Type: StringParameter Sets: (All)Aliases:
Required: FalsePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False
-DatasourceGroup
Specifies the group of the datasource. This parameter is optional and defaults to “PushModules” if not specified.
Type: StringParameter Sets: (All)Aliases:
Required: FalsePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False
-Instances
Specifies the instances of the resources to be updated. This parameter is mandatory and should contain results from the New-LMPushMetricInstance function.
Type: System.Collections.Generic.List`1[System.Object]Parameter Sets: (All)Aliases:
Required: TruePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False
-ProgressAction
Fill ProgressAction Description
Type: ActionPreferenceParameter Sets: (All)Aliases: proga
Required: FalsePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Inputs
Outputs
Notes
This function requires a valid API authentication. Make sure you are logged in before running any commands using Connect-LMAccount.