Skip to content

New-LMPushMetricDataPoint

Terminal window
New-LMPushMetricDataPoint [[-DataPointsArray] <System.Collections.Generic.List`1[System.Object]>]
[-DataPoints] <System.Collections.Generic.List`1[System.Object]> [[-DataPointType] <String>]
[[-DataPointAggregationType] <String>] [[-PercentileValue] <Int32>] [-ProgressAction <ActionPreference>]
[-WhatIf] [-Confirm] [<CommonParameters>]

The New-LMPushMetricDataPoint function creates a new data point object that can be used to push metric data to LogicMonitor. The function accepts an array of data points, where each data point consists of a name and a value. The function also allows you to specify the data point type, aggregation type, and percentile value.

Terminal window
$datapoints = @(
[PSCustomObject]@{
Name = "CPUUsage"
Value = 80
},
[PSCustomObject]@{
Name = "MemoryUsage"
Value = 60
}
)

New-LMPushMetricDataPoint -DataPoints $datapoints -DataPointType “gauge” -DataPointAggregationType “avg”

This example creates two data points for CPU usage and memory usage, and sets the data point type to “gauge” and the aggregation type to “avg”.

An optional parameter that allows you to pass an existing array of data points. If not provided, a new array will be created.

Type: System.Collections.Generic.List`1[System.Object]
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

A mandatory parameter that accepts an array of data points. Each data point should be an object with a Name and a Value property.

Type: System.Collections.Generic.List`1[System.Object]
Parameter Sets: (All)
Aliases:
Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

Specifies the type of the data point. Valid values are “counter”, “derive”, and “gauge”. The default value is “gauge”.

Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 3
Default value: Gauge
Accept pipeline input: False
Accept wildcard characters: False

Specifies the aggregation type of the data point. Valid values are “min”, “max”, “avg”, “sum”, “none”, and “percentile”. The default value is “none”.

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

Specifies the percentile value for the data point. This parameter is only applicable when the DataPointAggregationType is set to “percentile”. The value should be between 0 and 100.

Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: 5
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False

Shows what would happen if the cmdlet runs. The cmdlet is not run.

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

Prompts you for confirmation before running the cmdlet.

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

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

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

None. You cannot pipe objects to this command.

Section titled “None. You cannot pipe objects to this command.”

You must run Connect-LMAccount before running this command.