diff --git a/Documentation/Connect-LMAccount.md b/Documentation/Connect-LMAccount.md index a16cce3..70d7244 100644 --- a/Documentation/Connect-LMAccount.md +++ b/Documentation/Connect-LMAccount.md @@ -259,5 +259,6 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable You must run this command before you will be able to execute other commands included with the Logic.Monitor module. ## RELATED LINKS + [PSGallery: https://www.powershellgallery.com/packages/Logic.Monitor]() diff --git a/Documentation/Get-LMAccessGroup.md b/Documentation/Get-LMAccessGroup.md new file mode 100644 index 0000000..4bf9d3e --- /dev/null +++ b/Documentation/Get-LMAccessGroup.md @@ -0,0 +1,154 @@ +--- +external help file: Logic.Monitor-help.xml +Module Name: Logic.Monitor +online version: +schema: 2.0.0 +--- + +# Get-LMAccessGroup + +## SYNOPSIS +Retrieves LogicMonitor access groups based on specified parameters. + +## SYNTAX + +### All (Default) +``` +Get-LMAccessGroup [-BatchSize ] [-ProgressAction ] [] +``` + +### Id +``` +Get-LMAccessGroup [-Id ] [-BatchSize ] [-ProgressAction ] [] +``` + +### Name +``` +Get-LMAccessGroup [-Name ] [-BatchSize ] [-ProgressAction ] + [] +``` + +### Filter +``` +Get-LMAccessGroup [-Filter ] [-BatchSize ] [-ProgressAction ] + [] +``` + +## DESCRIPTION +The Get-LMAccessGroup function retrieves LogicMonitor access groups based on the specified parameters. +It supports retrieving access groups by ID, name, or using a filter. +The function uses the LogicMonitor REST API to make the requests. + +## EXAMPLES + +### EXAMPLE 1 +``` +Get-LMAccessGroup -Id 123 +Retrieves the access group with the specified ID. +``` + +### EXAMPLE 2 +``` +Get-LMAccessGroup -Name "MyAccessGroup" +Retrieves the access group with the specified name. +``` + +### EXAMPLE 3 +``` +Get-LMAccessGroup -Filter @{ Property = "Value" } +Retrieves access groups based on the specified filter criteria. +``` + +## PARAMETERS + +### -Id +Specifies the ID of the access group to retrieve. +This parameter is mutually exclusive with the Name and Filter parameters. + +```yaml +Type: Int32 +Parameter Sets: Id +Aliases: + +Required: False +Position: Named +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +Specifies the name of the access group to retrieve. +This parameter is mutually exclusive with the Id and Filter parameters. + +```yaml +Type: String +Parameter Sets: Name +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Filter +Specifies a filter object to retrieve access groups based on custom filter criteria. +This parameter is mutually exclusive with the Id and Name parameters. + +```yaml +Type: Object +Parameter Sets: Filter +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -BatchSize +Specifies the number of access groups to retrieve per request. +The default value is 1000. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: 1000 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProgressAction +{{ Fill ProgressAction Description }} + +```yaml +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](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES +This function requires a valid LogicMonitor API authentication. +Use Connect-LMAccount to authenticate before running this function. + +## RELATED LINKS diff --git a/Documentation/Get-LMDeviceInstanceData.md b/Documentation/Get-LMDeviceInstanceData.md new file mode 100644 index 0000000..d1e7e04 --- /dev/null +++ b/Documentation/Get-LMDeviceInstanceData.md @@ -0,0 +1,140 @@ +--- +external help file: Logic.Monitor-help.xml +Module Name: Logic.Monitor +online version: +schema: 2.0.0 +--- + +# Get-LMDeviceInstanceData + +## SYNOPSIS +Retrieves data for LogicMonitor device instances. + +## SYNTAX + +``` +Get-LMDeviceInstanceData [[-StartDate] ] [[-EndDate] ] [-Ids] + [[-AggregationType] ] [[-Period] ] [-ProgressAction ] [] +``` + +## DESCRIPTION +The Get-LMDeviceInstanceData function retrieves data for LogicMonitor device instances based on the specified parameters. + +## EXAMPLES + +### EXAMPLE 1 +``` +Get-LMDeviceInstanceData -StartDate (Get-Date).AddHours(-7) -EndDate (Get-Date) -Ids "12345", "67890" -AggregationType "average" -Period 1 +Retrieves data for the device instances with IDs "12345" and "67890" for the past 7 hours, using an average aggregation and a period of 1 day. +``` + +## PARAMETERS + +### -StartDate +The start date for the data retrieval. +If not specified, the function uses the default value of 24 hours ago which is the max timeframe for this endpoint. + +```yaml +Type: DateTime +Parameter Sets: (All) +Aliases: + +Required: False +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EndDate +The end date for the data retrieval. +If not specified, the function uses the current date and time. + +```yaml +Type: DateTime +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Ids +The array of device instance IDs for which to retrieve data. +This parameter is mandatory. + +```yaml +Type: String[] +Parameter Sets: (All) +Aliases: Id + +Required: True +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AggregationType +The type of aggregation to apply to the retrieved data. +Valid values are "first", "last", "min", "max", "sum", "average", and "none". +The default value is "none". + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 4 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Period +The period for the data retrieval. +The default value is 1. + +```yaml +Type: Double +Parameter Sets: (All) +Aliases: + +Required: False +Position: 5 +Default value: 1 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProgressAction +{{ Fill ProgressAction Description }} + +```yaml +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](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES +This function requires a valid LogicMonitor API authentication. +Make sure to log in using Connect-LMAccount before running this command. + +## RELATED LINKS diff --git a/Documentation/New-LMAlertEscalation.md b/Documentation/New-LMAlertEscalation.md new file mode 100644 index 0000000..f8d93ef --- /dev/null +++ b/Documentation/New-LMAlertEscalation.md @@ -0,0 +1,72 @@ +--- +external help file: Logic.Monitor-help.xml +Module Name: Logic.Monitor +online version: +schema: 2.0.0 +--- + +# New-LMAlertEscalation + +## SYNOPSIS +Creates a new escalation for a LogicMonitor alert. + +## SYNTAX + +``` +New-LMAlertEscalation [-Id] [-ProgressAction ] [] +``` + +## DESCRIPTION +The New-LMAlertEscalation function creates a new escalation for a LogicMonitor alert. +It checks if the user is logged in and has valid API credentials before making the API request to create the escalation. + +## EXAMPLES + +### EXAMPLE 1 +``` +New-LMAlertEscalation -Id "DS12345" +Creates a new escalation for the alert with ID "12345". +``` + +## PARAMETERS + +### -Id +The ID of the alert for which the escalation needs to be created. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -ProgressAction +{{ Fill ProgressAction Description }} + +```yaml +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](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS diff --git a/Public/Get-LMAccessGroup.ps1 b/Public/Get-LMAccessGroup.ps1 new file mode 100644 index 0000000..58bbdb0 --- /dev/null +++ b/Public/Get-LMAccessGroup.ps1 @@ -0,0 +1,115 @@ +<# +.SYNOPSIS +Retrieves LogicMonitor access groups based on specified parameters. + +.DESCRIPTION +The Get-LMAccessGroup function retrieves LogicMonitor access groups based on the specified parameters. It supports retrieving access groups by ID, name, or using a filter. The function uses the LogicMonitor REST API to make the requests. + +.PARAMETER Id +Specifies the ID of the access group to retrieve. This parameter is mutually exclusive with the Name and Filter parameters. + +.PARAMETER Name +Specifies the name of the access group to retrieve. This parameter is mutually exclusive with the Id and Filter parameters. + +.PARAMETER Filter +Specifies a filter object to retrieve access groups based on custom filter criteria. This parameter is mutually exclusive with the Id and Name parameters. + +.PARAMETER BatchSize +Specifies the number of access groups to retrieve per request. The default value is 1000. + +.EXAMPLE +Get-LMAccessGroup -Id 123 +Retrieves the access group with the specified ID. + +.EXAMPLE +Get-LMAccessGroup -Name "MyAccessGroup" +Retrieves the access group with the specified name. + +.EXAMPLE +Get-LMAccessGroup -Filter @{ Property = "Value" } +Retrieves access groups based on the specified filter criteria. + +.NOTES +This function requires a valid LogicMonitor API authentication. Use Connect-LMAccount to authenticate before running this function. +#> +Function Get-LMAccessGroup { + + [CmdletBinding(DefaultParameterSetName = 'All')] + Param ( + [Parameter(ParameterSetName = 'Id')] + [Int]$Id, + + [Parameter(ParameterSetName = 'Name')] + [String]$Name, + + [Parameter(ParameterSetName = 'Filter')] + [Object]$Filter, + + [ValidateRange(1,1000)] + [Int]$BatchSize = 1000 + ) + #Check if we are logged in and have valid api creds + If ($Script:LMAuth.Valid) { + + #Build header and uri + $ResourcePath = "/setting/accessgroup" + + #Initalize vars + $QueryParams = "" + $Count = 0 + $Done = $false + $Results = @() + + #Loop through requests + While (!$Done) { + #Build query params + Switch ($PSCmdlet.ParameterSetName) { + "All" { $QueryParams = "?size=$BatchSize&offset=$Count&sort=+id" } + "Id" { $resourcePath += "/$Id" } + "Name" { $QueryParams = "?filter=name:`"$Name`"&size=$BatchSize&offset=$Count&sort=+id" } + "Filter" { + #List of allowed filter props + $PropList = @() + $ValidFilter = Format-LMFilter -Filter $Filter -PropList $PropList + $QueryParams = "?filter=$ValidFilter&size=$BatchSize&offset=$Count&sort=+id" + } + } + Try { + $Headers = New-LMHeader -Auth $Script:LMAuth -Method "GET" -ResourcePath $ResourcePath + $Uri = "https://$($Script:LMAuth.Portal).logicmonitor.com/santaba/rest" + $ResourcePath + $QueryParams + + + + Resolve-LMDebugInfo -Url $Uri -Headers $Headers[0] -Command $MyInvocation + + #Issue request + $Response = Invoke-RestMethod -Uri $Uri -Method "GET" -Headers $Headers[0] -WebSession $Headers[1] + + #Stop looping if single device, no need to continue + If ($PSCmdlet.ParameterSetName -eq "Id") { + $Done = $true + Return (Add-ObjectTypeInfo -InputObject $Response -TypeName "LogicMonitor.Role" ) + } + #Check result size and if needed loop again + Else { + [Int]$Total = $Response.Total + [Int]$Count += ($Response.Items | Measure-Object).Count + $Results += $Response.Items + If ($Count -ge $Total) { + $Done = $true + } + } + } + Catch [Exception] { + $Proceed = Resolve-LMException -LMException $PSItem + If (!$Proceed) { + Return + } + } + } + Return (Add-ObjectTypeInfo -InputObject $Results -TypeName "LogicMonitor.Role" ) + } + Else { + Write-Error "Please ensure you are logged in before running any commands, use Connect-LMAccount to login and try again." + } +} diff --git a/Public/Get-LMDeviceInstanceData.ps1 b/Public/Get-LMDeviceInstanceData.ps1 new file mode 100644 index 0000000..f47a787 --- /dev/null +++ b/Public/Get-LMDeviceInstanceData.ps1 @@ -0,0 +1,99 @@ +<# +.SYNOPSIS +Retrieves data for LogicMonitor device instances. + +.DESCRIPTION +The Get-LMDeviceInstanceData function retrieves data for LogicMonitor device instances based on the specified parameters. + +.PARAMETER StartDate +The start date for the data retrieval. If not specified, the function uses the default value of 24 hours ago which is the max timeframe for this endpoint. + +.PARAMETER EndDate +The end date for the data retrieval. If not specified, the function uses the current date and time. + +.PARAMETER Ids +The array of device instance IDs for which to retrieve data. This parameter is mandatory. + +.PARAMETER AggregationType +The type of aggregation to apply to the retrieved data. Valid values are "first", "last", "min", "max", "sum", "average", and "none". The default value is "none". + +.PARAMETER Period +The period for the data retrieval. The default value is 1. + +.EXAMPLE +Get-LMDeviceInstanceData -StartDate (Get-Date).AddHours(-7) -EndDate (Get-Date) -Ids "12345", "67890" -AggregationType "average" -Period 1 +Retrieves data for the device instances with IDs "12345" and "67890" for the past 7 hours, using an average aggregation and a period of 1 day. + +.NOTES +This function requires a valid LogicMonitor API authentication. Make sure to log in using Connect-LMAccount before running this command. +#> +Function Get-LMDeviceInstanceData { + + [CmdletBinding()] + Param ( + [Datetime]$StartDate, + + [Datetime]$EndDate, + + [Parameter(Mandatory)] + [Alias("Id")] + [String[]]$Ids, + + [ValidateSet("first", "last", "min", "max", "sum", "average", "none")] + [String]$AggregationType = "none", + + [Double]$Period = 1 #Seems like the only value here is 1, so default to 1 + ) + #Check if we are logged in and have valid api creds + If ($Script:LMAuth.Valid) { + + #Build header and uri + $ResourcePath = "/device/instances/datafetch" + + #Initalize vars + $QueryParams = "" + $Results = @() + + #Convert to epoch, if not set use defaults + If (!$StartDate) { + [int]$StartDate = ([DateTimeOffset]$(Get-Date).AddHours(-24)).ToUnixTimeSeconds() + } + Else { + [int]$StartDate = ([DateTimeOffset]$($StartDate)).ToUnixTimeSeconds() + } + + If (!$EndDate) { + [int]$EndDate = ([DateTimeOffset]$(Get-Date)).ToUnixTimeSeconds() + } + Else { + [int]$EndDate = ([DateTimeOffset]$($EndDate)).ToUnixTimeSeconds() + } + + #Build query params + + $QueryParams = "?period=$Period&start=$StartDate&end=$EndDate&aggregate=$AggregationType" + + $Data = @{ + "instanceIds" = $Ids -join "," + } | ConvertTo-Json + + Try { + $Headers = New-LMHeader -Auth $Script:LMAuth -Method "POST" -ResourcePath $ResourcePath -Data $Data + $Uri = "https://$($Script:LMAuth.Portal).logicmonitor.com/santaba/rest" + $ResourcePath + $QueryParams + + Resolve-LMDebugInfo -Url $Uri -Headers $Headers[0] -Command $MyInvocation -Payload $Data + + #Issue request + $Response = Invoke-RestMethod -Uri $Uri -Method "POST" -Headers $Headers[0] -WebSession $Headers[1] -Body $Data + $Results = $Response.Items + } + Catch [Exception] { + Resolve-LMException -LMException $PSItem + } + + Return $Results + } + Else { + Write-Error "Please ensure you are logged in before running any commands, use Connect-LMAccount to login and try again." + } +} diff --git a/Public/New-LMAlertEscalation.ps1 b/Public/New-LMAlertEscalation.ps1 new file mode 100644 index 0000000..91d5913 --- /dev/null +++ b/Public/New-LMAlertEscalation.ps1 @@ -0,0 +1,57 @@ +<# +.SYNOPSIS +Creates a new escalation for a LogicMonitor alert. + +.DESCRIPTION +The New-LMAlertEscalation function creates a new escalation for a LogicMonitor alert. It checks if the user is logged in and has valid API credentials before making the API request to create the escalation. + +.PARAMETER Id +The ID of the alert for which the escalation needs to be created. + +.EXAMPLE +New-LMAlertEscalation -Id "DS12345" +Creates a new escalation for the alert with ID "12345". + +#> + +Function New-LMAlertEscalation { + [CmdletBinding()] + Param ( + [Parameter(Mandatory, ValueFromPipelineByPropertyName)] + [String]$Id + ) + Begin{} + Process{ + #Check if we are logged in and have valid api creds + If ($Script:LMAuth.Valid) { + + #Build header and uri + $ResourcePath = "/alert/alerts/$Id/escalate" + + Try { + + $Headers = New-LMHeader -Auth $Script:LMAuth -Method "POST" -ResourcePath $ResourcePath + $Uri = "https://$($Script:LMAuth.Portal).logicmonitor.com/santaba/rest" + $ResourcePath + + Resolve-LMDebugInfo -Url $Uri -Headers $Headers[0] -Command $MyInvocation + + #Issue request + $Response = Invoke-WebRequest -Uri $Uri -Method "POST" -Headers $Headers[0] -WebSession $Headers[1] + + If($Response.StatusCode -eq 200){ + Return "Successfully escalated alert id: $Id" + } + } + Catch [Exception] { + $Proceed = Resolve-LMException -LMException $PSItem + If (!$Proceed) { + Return + } + } + } + Else { + Write-Error "Please ensure you are logged in before running any commands, use Connect-LMAccount to login and try again." + } + } + End{} +} diff --git a/README.md b/README.md index f94f5fb..f44a6c2 100644 --- a/README.md +++ b/README.md @@ -186,272 +186,211 @@ Get-LMAlert -Filter "instanceName -eq 'Kubernetes_Scheduler' -and rule -eq 'Crit - [Code Snippet Library](EXAMPLES.md) - [Command Documentation](/Documentation) -# Available Commands ( over 168 to date) - -#### Account Connectivity +# Available Commands: - Connect-LMAccount -- Disconnect-LMAccount -- New-LMCachedAccount -- Get-LMCachedAccount -- Remove-LMCachedAccount* -#### Actuve Discovery +- Copy-LMDashboard +- Copy-LMDevice +- Copy-LMReport -- Invoke-LMActiveDiscovery +- Disconnect-LMAccount -#### Alerts +- Export-LMDeviceConfigBackup +- Export-LMDeviceData +- Export-LMLogicModule +- Get-LMAccessGroup +- Get-LMAccountStatus - Get-LMAlert -- New-LMAlertAck -- New-LMAlertNote - -#### Alert Rules - - Get-LMAlertRule - -#### API Tokens - - Get-LMAPIToken -- New-LMAPIToken -- Set-LMAPIToken* -- Remove-LMAPIToken* - -#### AplliesTo - - Get-LMAppliesToFunction -- New-LMAppliesToFunction -- Set-LMAppliesToFunction -- Remove-LMAppliesToFunction - -#### Audit/Integration Logs - - Get-LMAuditLogs -- Get-LMIntegrationLogs - -#### Collector - +- Get-LMCachedAccount - Get-LMCollector +- Get-LMCollectorDebugResult - Get-LMCollectorGroup - Get-LMCollectorInstaller -- Get-LMCollectorVersion -- New-LMCollector -- Set-LMCollector* -- Set-LMCollectorConfig* -- Set-LMCollectorGroup* -- Remove-LMCollectorGroup* -- New-LMCollectorGroup - -#### Collector Debug - -- Get-LMCollectorDebugResult -- Invoke-LMCollectorDebugCommand - -#### Dashboards - +- Get-LMCollectorVersions +- Get-LMConfigSource - Get-LMDashboard -- Copy-LMDashboard - Get-LMDashboardGroup - Get-LMDashboardWidget -- Remove-LMDashboard* -- Remove-LMDashboardGroup* -- Remove-LMDashboardWidget* -- Import-LMDashboard -- New-LMDashboardGroup - -#### Datasources/LogicModules - - Get-LMDatasource +- Get-LMDatasourceAssociatedDevices - Get-LMDatasourceGraph -- New-LMDatasourceGraph +- Get-LMDatasourceMetadata - Get-LMDatasourceOverviewGraph -- New-LMDatasourceOverviewGraph -- Set-LMDatasource* -- Set-LMTopologysource* -- Set-LMPropertysource* -- Set-LMConfigsource* -- Get-LMDatasourceAssociatedDevices - Get-LMDatasourceUpdateHistory -- Get-LMDatasourceMetadata -- Remove-LMDatasource* -- Remove-LMConfigsource* -- Remove-LMTopologysource* -- Remove-LMPropertysource* -- Get-LMEventSource -- Get-LMPropertySource -- Get-LMTopologySource -- Get-LMConfigSource -- Export-LMLogicModule* -- Import-LMLogicModule -- Import-LMExchangeModule - -#### Devices - -- Copy-LMDevice - Get-LMDevice -- Get-LMDeviceSDT -- Get-LMDeviceSDTHistory -- Get-LMDeviceProperty -- Get-LMDeviceAlerts* -- Get-LMDeviceAlertSettings* +- Get-LMDeviceAlerts +- Get-LMDeviceAlertSettings +- Get-LMDeviceConfigSourceData - Get-LMDeviceData - Get-LMDeviceDatasourceInstance -- Get-LMDeviceDatasourceInstanceGroup - Get-LMDeviceDatasourceInstanceAlertSetting -- Set-LMDeviceDatasourceInstanceAlertSetting +- Get-LMDeviceDatasourceInstanceGroup - Get-LMDeviceDatasourceList -- Get-LMDeviceEventsourceList -- Get-LMDeviceInstanceList -- Export-LMDeviceConfigBackup -- Get-LMDeviceConfigSourceData -- New-LMDevice -- New-LMDeviceDatasourceInstance -- New-LMDeviceDatasourceInstanceGroup -- Set-LMDeviceDatasourceInstance* -- New-LMDeviceProperty -- Set-LMDevice* -- Set-LMDeviceProperty* -- Remove-LMDevice* -- Remove-LMDeviceDatasourceInstance* -- Remove-DeviceProperty* -- Export-LMDeviceData -- Invoke-LMDeviceConfigSourceCollection - -#### Device Groups - -- Get-LMDeviceGroup* -- Get-LMDeviceGroupSDT -- Get-LMDeviceGroupSDTHistory -- Get-LMDeviceGroupAlerts* +- Get-LMDeviceEventSourceList +- Get-LMDeviceGroup +- Get-LMDeviceGroupAlerts - Get-LMDeviceGroupDatasourceAlertSetting - Get-LMDeviceGroupDatasourceList - Get-LMDeviceGroupDevices - Get-LMDeviceGroupGroups - Get-LMDeviceGroupProperty -- New-LMDeviceGroup -- New-LMDeviceGroupProperty -- Set-LMDeviceGroup* -- Set-LMDeviceGroupDatasourceAlertSetting -- Remove-LMDeviceGroup* - -#### Escalation Chain - +- Get-LMDeviceGroupSDT +- Get-LMDeviceGroupSDTHistory +- Get-LMDeviceInstanceData +- Get-LMDeviceInstanceList +- Get-LMDeviceNetflowEndpoints +- Get-LMDeviceNetflowFlows +- Get-LMDeviceNetflowPorts +- Get-LMDeviceProperty +- Get-LMDeviceSDT +- Get-LMDeviceSDTHistory - Get-LMEscalationChain - -#### LM Logs - -- Send-LMLogMessage - -#### Netscan - +- Get-LMEventSource +- Get-LMIntegrationLogs - Get-LMNetscan - Get-LMNetscanExecution - Get-LMNetscanExecutionDevices -- New-LMNetscan -- Set-LMNetscan* -- Remove-LMNetscan* -- Invoke-LMNetscan -- Invoke-LMCloudGroupNetScan -- Get-LMUnmonitoredDevice -- Set-LMUnmonitoredDevice -- Remove-LMUnmonitoredDevice - Get-LMNetscanGroup -- Set-LMNetscanGroup* -- Remove-LMNetscanGroup* -- New-LMNetscanGroup - -#### Ops Notes - - Get-LMOpsNote -- New-LMOpsNote -- Set-LMOpsNote* -- Remove-LMOpsNote* - -#### Portal Info - - Get-LMPortalInfo -- Get-LMUsageMetrics -- Set-LMPortalInfo -- Set-LMNewUserMessage - -#### Push Metrics (Ingest API) -- New-LMPushMetricDataPoint -- New-LMPushMetricInstance -- Send-LMPushMetric -- Set-LMPushModuleDeviceProperty -- Set-LMPushModuleInstanceProperty - -#### Recipient Group - +- Get-LMPropertySource - Get-LMRecipientGroup - -#### Reports - -- Copy-LMReport - Get-LMReport - Get-LMReportGroup -- New-LMReportGroup -- Set-LMReportGroup* -- Remove-LMReportGroup* -- Remove-LMReport* - -#### Repository (LogicModules) - - Get-LMRepositoryLogicModules -- Import-LMRepositoryLogicModules* - -#### SDT (Scheduled Down Time) +- Get-LMRole - Get-LMSDT -- Set-LMSDT* -- Remove-LMSDT* -- New-LMDeviceSDT -- New-LMDeviceGroupSDT -- New-LMDeviceDatasourceSDT -- New-LMDeviceDatasourceInstanceSDT - -#### Topology (Beta) - - Get-LMTopologyMap - Get-LMTopologyMapData - -#### Users and Roles - -- Get-LMRole +- Get-LMTopologySource +- Get-LMUnmonitoredDevice +- Get-LMUsageMetrics - Get-LMUser - Get-LMUserGroup -- New-LMUser -- New-LMRole -- New-LMApiUser -- Set-LMUser* -- Set-LMRole* -- Remove-LMUser* -- Remove-LMRole* -- Invoke-LMUserLogoff - -#### Websites - - Get-LMWebsite - Get-LMWebsiteAlerts -- Get-LMWebsiteCheckPoint +- Get-LMWebsiteCheckpoint - Get-LMWebsiteData +- Get-LMWebsiteGroup +- Get-LMWebsiteGroupAlerts +- Get-LMWebsiteGroupSDT +- Get-LMWebsiteGroupSDTHistory - Get-LMWebsiteProperty - Get-LMWebsiteSDT - Get-LMWebsiteSDTHistory -- New-LMWebsite -- Set-LMWebsite* -- Remove-LMWebsite* -#### Website Groups +- Import-LMDashboard +- Import-LMExchangeModule +- Import-LMLogicModule +- Import-LMRepositoryLogicModules -- Get-LMWebsiteGroup -- Get-LMWebsiteGroupAlerts -- Get-LMWebsiteGroupSDT -- Get-LMWebsiteGroupSDTHistory +- Invoke-LMActiveDiscovery +- Invoke-LMCloudGroupNetScan +- Invoke-LMCollectorDebugCommand +- Invoke-LMDeviceConfigSourceCollection +- Invoke-LMNetScan +- Invoke-LMUserLogoff + +- New-LMAlertAck +- New-LMAlertEscalation +- New-LMAlertNote +- New-LMAPIToken +- New-LMAPIUser +- New-LMAppliesToFunction +- New-LMCachedAccount +- New-LMCollector +- New-LMCollectorGroup +- New-LMDashboardGroup +- New-LMDatasourceGraph +- New-LMDatasourceOverviewGraph +- New-LMDevice +- New-LMDeviceDatasourceInstance +- New-LMDeviceDatasourceInstanceGroup +- New-LMDeviceDatasourceInstanceSDT +- New-LMDeviceDatasourceSDT +- New-LMDeviceGroup +- New-LMDeviceGroupSDT +- New-LMDeviceProperty +- New-LMDeviceSDT +- New-LMEnhancedNetScan +- New-LMNetScan +- New-LMNetscanGroup +- New-LMOpsNote +- New-LMPushMetricDataPoint +- New-LMPushMetricInstance +- New-LMReportGroup +- New-LMRole +- New-LMUser +- New-LMWebsite - New-LMWebsiteGroup -- Set-LMWebsiteGroup* -- Remove-LMWebsiteGroup* -***Note**: Supports Pipeline Input +- Remove-LMAPIToken +- Remove-LMAppliesToFunction +- Remove-LMCachedAccount +- Remove-LMCollectorGroup +- Remove-LMConfigsource +- Remove-LMDashboard +- Remove-LMDashboardGroup +- Remove-LMDashboardWidget +- Remove-LMDatasource +- Remove-LMDevice +- Remove-LMDeviceDatasourceInstance +- Remove-LMDeviceGroup +- Remove-LMDeviceProperty +- Remove-LMNetscan +- Remove-LMNetscanGroup +- Remove-LMOpsNote +- Remove-LMPropertysource +- Remove-LMReport +- Remove-LMReportGroup +- Remove-LMRole +- Remove-LMSDT +- Remove-LMTopologysource +- Remove-LMUnmonitoredDevice +- Remove-LMUser +- Remove-LMWebsite +- Remove-LMWebsiteGroup + +- Send-LMLogMessage +- Send-LMPushMetric + +- Set-LMAPIToken +- Set-LMAppliesToFunction +- Set-LMCollector +- Set-LMCollectorConfig +- Set-LMCollectorGroup +- Set-LMConfigsource +- Set-LMDatasource +- Set-LMDevice +- Set-LMDeviceDatasourceInstance +- Set-LMDeviceDatasourceInstanceAlertSetting +- Set-LMDeviceGroup +- Set-LMDeviceGroupDatasourceAlertSetting +- Set-LMDeviceProperty +- Set-LMNetscan +- Set-LMNetscanGroup +- Set-LMNewUserMessage +- Set-LMOpsNote +- Set-LMPortalInfo +- Set-LMPropertysource +- Set-LMPushModuleDeviceProperty +- Set-LMPushModuleInstanceProperty +- Set-LMReportGroup +- Set-LMRole +- Set-LMSDT +- Set-LMTopologysource +- Set-LMUnmonitoredDevice +- Set-LMUser +- Set-LMWebsite +- Set-LMWebsiteGroup + +**Note**: Some commands accept pipeline input, see `Get-Command -Module Logic.Monitor` for details. # Change List @@ -472,8 +411,17 @@ This change aims to enhance visibility within the community and to foster a more We appreciate your continued support and enthusiasm for the Logic.Monitor PowerShell module. Your contributions and feedback are vital to the success of this project, and we look forward to seeing how the module evolves with your participation. ## 6.0 -### Updated Cmdlets: +### New Cmdlets: + - **Get-LMDeviceInstanceData**: This cmdlet retrieves data for LogicMonitor device instances based on the specified parameters. The cmdlet can only retrieve data within the last 24 hours. You can use `Get-LMDeviceInstanceList` to quickly get a list of instances for a particular device. + - **New-LMAlertEscalation**: This cmdlet invokes an escalation for a LogicMonitor alert. It takes a *-Ids* parameter which is an array of alert ids to escalate. + - **Get-LMAccessGroup**: This cmdlet will retrieve data for specified LogicMonitor access groups. You can retrieve all access groups or limit the results using *-Id*, *-Name* or *-Filter* parameters. + + **Note**: Access Groups are not available in all portals and needs to be enabled before any access group commands can be utilized. + +### Updated Cmdlets: + - **Set-LMDeviceDatasourceInstanceAlertSetting**: AlertForNoData, AlertClearTransitionInterval and AlertTransitionInterval parameters are now mandatory as a result of endpoint changes for LM APIv3. These values can now be set at instance and group level overrides and as a result must be specified when modifying alert thresholds. + - **Set-LMDeviceGroupDatasourceAlertSetting**: AlertForNoData, AlertClearTransitionInterval and AlertTransitionInterval parameters are now mandatory as a result of endpoint changes for LM APIv3. These values can now be set at instance and group level overrides and as a result must be specified when modifying alert thresholds. [Previous Release Notes](RELEASENOTES.md) diff --git a/en-US/Logic.Monitor-help.xml b/en-US/Logic.Monitor-help.xml index dbb4b19..37857cf 100644 --- a/en-US/Logic.Monitor-help.xml +++ b/en-US/Logic.Monitor-help.xml @@ -542,10 +542,6 @@ - - Module repo: https://github.com/logicmonitor/lm-powershell-module - - PSGallery: https://www.powershellgallery.com/packages/Logic.Monitor @@ -1293,10 +1289,6 @@ Creates a copy of the device specified by the $deviceObject variable with the na - - Module repo: https://github.com/logicmonitor/lm-powershell-module - - PSGallery: https://www.powershellgallery.com/packages/Logic.Monitor @@ -1550,10 +1542,6 @@ Creates a copy of the device specified by the $deviceObject variable with the na - - Module repo: https://github.com/logicmonitor/lm-powershell-module - - PSGallery: https://www.powershellgallery.com/packages/Logic.Monitor @@ -2451,10 +2439,6 @@ Creates a copy of the device specified by the $deviceObject variable with the na - - Module repo: https://github.com/logicmonitor/lm-powershell-module - - PSGallery: https://www.powershellgallery.com/packages/Logic.Monitor