Skip to content

Commit b725e1d

Browse files
committed
7.7.3 release
## 7.7.3 ### Hotfixes - **New-LMAlertRule**: Fixed bug where datapoint, instance and datasource where not properly being set due to a change in the field names. - **Set-LMAlertRule**: Fixed bug where datapoint, instance and datasource where not properly being set due to a change in the field names.
1 parent 5a82d40 commit b725e1d

4 files changed

Lines changed: 127 additions & 121 deletions

File tree

Public/New-LMAlertRule.ps1

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ function New-LMAlertRule {
8484

8585
[String]$DataSource,
8686

87-
[String]$DataSourceInstanceName,
87+
[Alias("DataSourceInstanceName")]
88+
[String]$Instance,
8889

8990
[String]$DataPoint,
9091

@@ -120,9 +121,9 @@ function New-LMAlertRule {
120121
if ($ResourceProperties) { $Data.Add("resourceProperties", $ResourceProperties) }
121122
if ($Devices) { $Data.Add("devices", $Devices) }
122123
if ($DeviceGroups) { $Data.Add("deviceGroups", $DeviceGroups) }
123-
if ($DataSource) { $Data.Add("dataSource", $DataSource) }
124-
if ($DataSourceInstanceName) { $Data.Add("dataSourceInstanceName", $DataSourceInstanceName) }
125-
if ($DataPoint) { $Data.Add("dataPoint", $DataPoint) }
124+
if ($DataSource) { $Data.Add("datasource", $DataSource) }
125+
if ($Instance) { $Data.Add("instance", $Instance) }
126+
if ($DataPoint) { $Data.Add("datapoint", $DataPoint) }
126127
if ($PSBoundParameters.ContainsKey("SuppressAlertClear")) { $Data.Add("suppressAlertClear", $SuppressAlertClear) }
127128
if ($PSBoundParameters.ContainsKey("SuppressAlertAckSdt")) { $Data.Add("suppressAlertAckSdt", $SuppressAlertAckSdt) }
128129
if ($Description) { $Data.Add("description", $Description) }

Public/Set-LMAlertRule.ps1

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,12 @@ function Set-LMAlertRule {
9292

9393
[String[]]$DeviceGroups,
9494

95-
[String]$DataSource,
95+
[String]$Datasource,
9696

97-
[String]$DataSourceInstanceName,
97+
[Alias("DataSourceInstanceName")]
98+
[String]$Instance,
9899

99-
[String]$DataPoint,
100+
[String]$Datapoint,
100101

101102
[Boolean]$SuppressAlertClear,
102103

@@ -137,9 +138,9 @@ function Set-LMAlertRule {
137138
if ($ResourceProperties) { $Data.Add("resourceProperties", $ResourceProperties) }
138139
if ($Devices) { $Data.Add("devices", $Devices) }
139140
if ($DeviceGroups) { $Data.Add("deviceGroups", $DeviceGroups) }
140-
if ($DataSource) { $Data.Add("dataSource", $DataSource) }
141-
if ($DataSourceInstanceName) { $Data.Add("dataSourceInstanceName", $DataSourceInstanceName) }
142-
if ($DataPoint) { $Data.Add("dataPoint", $DataPoint) }
141+
if ($DataSource) { $Data.Add("datasource", $DataSource) }
142+
if ($Instance) { $Data.Add("instance", $Instance) }
143+
if ($DataPoint) { $Data.Add("datapoint", $DataPoint) }
143144
if ($PSBoundParameters.ContainsKey("SuppressAlertClear")) { $Data.Add("suppressAlertClear", $SuppressAlertClear) }
144145
if ($PSBoundParameters.ContainsKey("SuppressAlertAckSdt")) { $Data.Add("suppressAlertAckSdt", $SuppressAlertAckSdt) }
145146
if ($LevelStr) { $Data.Add("levelStr", $LevelStr) }

README.md

Lines changed: 3 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -73,118 +73,10 @@ Connect-LMAccount -UseCachedCredential
7373

7474
# Change List
7575

76-
## 7.7.2
76+
## 7.7.3
7777
### Hotfixes
78-
- **Send-LMWebhookMessage**: Fixed payload formatting when sending webhook messages to LM Logs:
79-
- JSON strings are now automatically detected and parsed into structured data, preventing escaped JSON in payloads
80-
- Plain text messages are properly encapsulated in a `message` property for consistent parsing
81-
- Removed unnecessary payload wrapping that caused ingestion issues
82-
- **Resolve-LMDebugInfo**: Fix bug where BearerTokens were not being obfuscated when running commands with the -Debug parameter.
83-
84-
```powershell
85-
#Sends multiple PSCustomObject events with additional properties merged into each payload.
86-
$events = @(
87-
[PSCustomObject]@{ eventType = "login"; user = "john.doe"; status = "success" }
88-
[PSCustomObject]@{ eventType = "logout"; user = "jane.smith"; status = "success" }
89-
)
90-
Send-LMWebhookMessage -SourceName "AuthEvents" -Messages $events -Properties @{ source = "AD"; region = "us-east-1" }
91-
92-
#Sends a hashtable as a structured event and returns the result with status information.
93-
$event = @{
94-
eventType = "deployment"
95-
version = "1.2.3"
96-
environment = "production"
97-
timestamp = (Get-Date).ToString("o")
98-
}
99-
Send-LMWebhookMessage -SourceName "Deployments" -Messages @($event) -PassThru
100-
```
101-
102-
## 7.7.1
103-
### Hotfixes
104-
- Fix bug with **ConvertTo-LMUpdateDevice** when trying to migrate Websites using an packet count of 50.
105-
- Add missing parameter descriptions to 17 cmdlets.
106-
- Automate future help/doc generation when a new release is published.
107-
108-
## 7.7.0
109-
110-
### New Cmdlets
111-
- **Get-LMRecentlyDeleted**: Retrieve recycle-bin entries with optional date, resource type, and deleted-by filters.
112-
- **Restore-LMRecentlyDeleted**: Batch restore recycle-bin items by recycle identifier.
113-
- **Remove-LMRecentlyDeleted**: Permanently delete recycle-bin entries in bulk.
114-
- **Get-LMIntegration**: Retrieve integration configurations from LogicMonitor.
115-
- **Remove-LMIntegration**: Remove integrations by ID or name.
116-
- **Remove-LMEscalationChain**: Remove escalation chains by ID or name.
117-
- **Invoke-LMReportExecution**: Trigger on-demand execution of LogicMonitor reports with optional admin impersonation and custom email recipients.
118-
- **Get-LMReportExecutionTask**: Check the status and retrieve results of previously triggered report executions.
119-
- **Invoke-LMAPIRequest**: Universal API request cmdlet for advanced users to access any LogicMonitor API endpoint with custom payloads while leveraging module authentication, retry logic, and debug utilities.
120-
- **Import-LMLogicModuleFromFile**: Import LogicModules using the new XML and JSON import endpoints with enhanced features including field preservation and conflict handling options. Supports datasources, configsources, eventsources, batchjobs, logsources, oids, topologysources, functions, and diagnosticsources.
121-
122-
### Updated Cmdlets
123-
- **Update-LogicMonitorModule**: Hardened for non-blocking version checks; failures are logged via `Write-Verbose` and never terminate connecting cmdlets.
124-
- **Export-LMDeviceData**: CSV exports now expand datapoints into individual rows and JSON exports capture deeper datapoint structures.
125-
- **Set-LMWebsite**: Added `alertExpr` alias for `SSLAlertThresholds` parameter for improved API compatibility. Updated synopsis to reflect enhanced parameter validation.
126-
- **New-LMWebsite**: Added `alertExpr` alias for `SSLAlertThresholds` parameter for improved API compatibility.
127-
- **Format-LMFilter**: Enhanced filter string escaping to properly handle special characters like parentheses, dollar signs, ampersands, and brackets in filter expressions.
128-
- **Import-LMLogicModule**: Marked as deprecated with warnings. Users should migrate to `Import-LMLogicModuleFromFile` for access to newer API endpoints and features.
129-
130-
### Bug Fixes
131-
- **Add-ObjectTypeInfo**: Fixed "Cannot bind argument to parameter 'InputObject' because it is null" error by adding `[AllowNull()]` attribute to handle successful but null API responses.
132-
- **Resolve-LMDebugInfo**: Improved HTTP method detection logic to correctly identify request types (GET, POST, PATCH, DELETE) based on cmdlet naming conventions and headers, fixing incorrect debug output.
133-
- **Invoke-LMRestMethod**: Added cleanup of internal `__LMMethod` diagnostic header before dispatching requests to prevent API errors.
134-
135-
### Examples
136-
```powershell
137-
# Retrieve all recently deleted devices for the past seven days
138-
Get-LMRecentlyDeleted -ResourceType device -DeletedBy "lmsupport" -Verbose
139-
140-
# Restore a previously deleted device and confirm the operation
141-
Get-LMRecentlyDeleted -ResourceType device | Select-Object -First 1 -ExpandProperty id | Restore-LMRecentlyDeleted -Confirm:$false
142-
143-
# Permanently remove stale recycle-bin entries
144-
Get-LMRecentlyDeleted -DeletedAfter (Get-Date).AddMonths(-1) | Select-Object -ExpandProperty id | Remove-LMRecentlyDeleted -Confirm:$false
145-
146-
# Export device datapoints to CSV with flattened datapoint rows
147-
Export-LMDeviceData -DeviceId 12345 -StartDate (Get-Date).AddHours(-6) -ExportFormat csv -ExportPath "C:\\Exports"
148-
149-
# Retrieve all integrations
150-
Get-LMIntegration
151-
152-
# Remove an integration by name
153-
Remove-LMIntegration -Name "Slack-Integration"
154-
155-
# Remove an escalation chain by ID
156-
Remove-LMEscalationChain -Id 123
157-
158-
# Trigger a report execution and check its status
159-
$task = Invoke-LMReportExecution -Name "Monthly Availability" -WithAdminId 101 -ReceiveEmails "ops@example.com"
160-
Get-LMReportExecutionTask -ReportName "Monthly Availability" -TaskId $task.taskId
161-
162-
# Use the universal API request cmdlet for endpoints
163-
Invoke-LMAPIRequest -ResourcePath "/setting/integrations" -Method GET -QueryParams @{ size = 500 }
164-
165-
# Create a device with full control
166-
$customData = @{
167-
name = "1.1.1.1"
168-
displayName = "Custom Device"
169-
preferredCollectorId = 76
170-
deviceType = 0
171-
customProperties = @(
172-
@{name="propname";value="value"}
173-
)
174-
}
175-
Invoke-LMAPIRequest -ResourcePath "/device/devices" -Method POST -Data $customData -Version 3
176-
177-
# Import a LogicModule from file with the new endpoint
178-
Import-LMLogicModuleFromFile -FilePath "C:\LogicModules\datasource.json" -Type datasources -Format json
179-
180-
# Import with conflict handling and field preservation
181-
Import-LMLogicModuleFromFile -FilePath "C:\LogicModules\datasource.json" -Type datasources -Format json -HandleConflict FORCE_OVERWRITE -FieldsToPreserve NAME
182-
183-
# Import from file data variable
184-
$fileContent = Get-Content -Path "C:\LogicModules\eventsource.xml" -Raw
185-
Import-LMLogicModuleFromFile -File $fileContent -Type eventsources -Format xml
186-
```
187-
78+
- **New-LMAlertRule**: Fixed bug where datapoint, instance and datasource where not properly being set due to a change in the field names.
79+
- **Set-LMAlertRule**: Fixed bug where datapoint, instance and datasource where not properly being set due to a change in the field names.
18880

18981
---
19082

RELEASENOTES.md

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,116 @@
11
# Previous module release notes
2+
## 7.7.2
3+
### Hotfixes
4+
- **Send-LMWebhookMessage**: Fixed payload formatting when sending webhook messages to LM Logs:
5+
- JSON strings are now automatically detected and parsed into structured data, preventing escaped JSON in payloads
6+
- Plain text messages are properly encapsulated in a `message` property for consistent parsing
7+
- Removed unnecessary payload wrapping that caused ingestion issues
8+
- **Resolve-LMDebugInfo**: Fix bug where BearerTokens were not being obfuscated when running commands with the -Debug parameter.
9+
10+
```powershell
11+
#Sends multiple PSCustomObject events with additional properties merged into each payload.
12+
$events = @(
13+
[PSCustomObject]@{ eventType = "login"; user = "john.doe"; status = "success" }
14+
[PSCustomObject]@{ eventType = "logout"; user = "jane.smith"; status = "success" }
15+
)
16+
Send-LMWebhookMessage -SourceName "AuthEvents" -Messages $events -Properties @{ source = "AD"; region = "us-east-1" }
17+
18+
#Sends a hashtable as a structured event and returns the result with status information.
19+
$event = @{
20+
eventType = "deployment"
21+
version = "1.2.3"
22+
environment = "production"
23+
timestamp = (Get-Date).ToString("o")
24+
}
25+
Send-LMWebhookMessage -SourceName "Deployments" -Messages @($event) -PassThru
26+
```
27+
28+
## 7.7.1
29+
### Hotfixes
30+
- Fix bug with **ConvertTo-LMUpdateDevice** when trying to migrate Websites using an packet count of 50.
31+
- Add missing parameter descriptions to 17 cmdlets.
32+
- Automate future help/doc generation when a new release is published.
33+
34+
## 7.7.0
35+
36+
### New Cmdlets
37+
- **Get-LMRecentlyDeleted**: Retrieve recycle-bin entries with optional date, resource type, and deleted-by filters.
38+
- **Restore-LMRecentlyDeleted**: Batch restore recycle-bin items by recycle identifier.
39+
- **Remove-LMRecentlyDeleted**: Permanently delete recycle-bin entries in bulk.
40+
- **Get-LMIntegration**: Retrieve integration configurations from LogicMonitor.
41+
- **Remove-LMIntegration**: Remove integrations by ID or name.
42+
- **Remove-LMEscalationChain**: Remove escalation chains by ID or name.
43+
- **Invoke-LMReportExecution**: Trigger on-demand execution of LogicMonitor reports with optional admin impersonation and custom email recipients.
44+
- **Get-LMReportExecutionTask**: Check the status and retrieve results of previously triggered report executions.
45+
- **Invoke-LMAPIRequest**: Universal API request cmdlet for advanced users to access any LogicMonitor API endpoint with custom payloads while leveraging module authentication, retry logic, and debug utilities.
46+
- **Import-LMLogicModuleFromFile**: Import LogicModules using the new XML and JSON import endpoints with enhanced features including field preservation and conflict handling options. Supports datasources, configsources, eventsources, batchjobs, logsources, oids, topologysources, functions, and diagnosticsources.
47+
48+
### Updated Cmdlets
49+
- **Update-LogicMonitorModule**: Hardened for non-blocking version checks; failures are logged via `Write-Verbose` and never terminate connecting cmdlets.
50+
- **Export-LMDeviceData**: CSV exports now expand datapoints into individual rows and JSON exports capture deeper datapoint structures.
51+
- **Set-LMWebsite**: Added `alertExpr` alias for `SSLAlertThresholds` parameter for improved API compatibility. Updated synopsis to reflect enhanced parameter validation.
52+
- **New-LMWebsite**: Added `alertExpr` alias for `SSLAlertThresholds` parameter for improved API compatibility.
53+
- **Format-LMFilter**: Enhanced filter string escaping to properly handle special characters like parentheses, dollar signs, ampersands, and brackets in filter expressions.
54+
- **Import-LMLogicModule**: Marked as deprecated with warnings. Users should migrate to `Import-LMLogicModuleFromFile` for access to newer API endpoints and features.
55+
56+
### Bug Fixes
57+
- **Add-ObjectTypeInfo**: Fixed "Cannot bind argument to parameter 'InputObject' because it is null" error by adding `[AllowNull()]` attribute to handle successful but null API responses.
58+
- **Resolve-LMDebugInfo**: Improved HTTP method detection logic to correctly identify request types (GET, POST, PATCH, DELETE) based on cmdlet naming conventions and headers, fixing incorrect debug output.
59+
- **Invoke-LMRestMethod**: Added cleanup of internal `__LMMethod` diagnostic header before dispatching requests to prevent API errors.
60+
61+
### Examples
62+
```powershell
63+
# Retrieve all recently deleted devices for the past seven days
64+
Get-LMRecentlyDeleted -ResourceType device -DeletedBy "lmsupport" -Verbose
65+
66+
# Restore a previously deleted device and confirm the operation
67+
Get-LMRecentlyDeleted -ResourceType device | Select-Object -First 1 -ExpandProperty id | Restore-LMRecentlyDeleted -Confirm:$false
68+
69+
# Permanently remove stale recycle-bin entries
70+
Get-LMRecentlyDeleted -DeletedAfter (Get-Date).AddMonths(-1) | Select-Object -ExpandProperty id | Remove-LMRecentlyDeleted -Confirm:$false
71+
72+
# Export device datapoints to CSV with flattened datapoint rows
73+
Export-LMDeviceData -DeviceId 12345 -StartDate (Get-Date).AddHours(-6) -ExportFormat csv -ExportPath "C:\\Exports"
74+
75+
# Retrieve all integrations
76+
Get-LMIntegration
77+
78+
# Remove an integration by name
79+
Remove-LMIntegration -Name "Slack-Integration"
80+
81+
# Remove an escalation chain by ID
82+
Remove-LMEscalationChain -Id 123
83+
84+
# Trigger a report execution and check its status
85+
$task = Invoke-LMReportExecution -Name "Monthly Availability" -WithAdminId 101 -ReceiveEmails "ops@example.com"
86+
Get-LMReportExecutionTask -ReportName "Monthly Availability" -TaskId $task.taskId
87+
88+
# Use the universal API request cmdlet for endpoints
89+
Invoke-LMAPIRequest -ResourcePath "/setting/integrations" -Method GET -QueryParams @{ size = 500 }
90+
91+
# Create a device with full control
92+
$customData = @{
93+
name = "1.1.1.1"
94+
displayName = "Custom Device"
95+
preferredCollectorId = 76
96+
deviceType = 0
97+
customProperties = @(
98+
@{name="propname";value="value"}
99+
)
100+
}
101+
Invoke-LMAPIRequest -ResourcePath "/device/devices" -Method POST -Data $customData -Version 3
102+
103+
# Import a LogicModule from file with the new endpoint
104+
Import-LMLogicModuleFromFile -FilePath "C:\LogicModules\datasource.json" -Type datasources -Format json
105+
106+
# Import with conflict handling and field preservation
107+
Import-LMLogicModuleFromFile -FilePath "C:\LogicModules\datasource.json" -Type datasources -Format json -HandleConflict FORCE_OVERWRITE -FieldsToPreserve NAME
108+
109+
# Import from file data variable
110+
$fileContent = Get-Content -Path "C:\LogicModules\eventsource.xml" -Raw
111+
Import-LMLogicModuleFromFile -File $fileContent -Type eventsources -Format xml
112+
```
113+
2114

3115
## 7.6.1
4116

0 commit comments

Comments
 (0)