Skip to content

Send-LMPushMetric

Syntax

Create-DatasourceName

Terminal window
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

Terminal window
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

Terminal window
Send-LMPushMetric -NewResourceHostName "NewResource" -NewResourceDescription "New Resource Description" -ResourceIds @{"system.deviceId"="12345"} -ResourceProperties @{"Property1"="Value1"} -DatasourceId "123" -Instances $Instances
Creates 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: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept 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: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ResourceIds

Specifies the resource IDs to use for resource mapping. This parameter is mandatory.

Type: Hashtable
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ResourceProperties

Specifies the properties of the resources to be updated. This parameter is optional.

Type: Hashtable
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-DatasourceId

Specifies the ID of the datasource. This parameter is required if the datasource name is not specified.

Type: String
Parameter Sets: Create-DatasourceId
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-DatasourceName

Specifies the name of the datasource. This parameter is required if the datasource ID is not specified.

Type: String
Parameter Sets: Create-DatasourceName
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept 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: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-DatasourceGroup

Specifies the group of the datasource. This parameter is optional and defaults to “PushModules” if not specified.

Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept 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: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ProgressAction

Fill ProgressAction Description

Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept 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.