Skip to content

Commit aae1d8c

Browse files
committed
fix websites bug with serialization
1 parent c6f62e1 commit aae1d8c

3 files changed

Lines changed: 63 additions & 6 deletions

File tree

Public/Get-LMUsageMetric.ps1

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
<#
2+
.SYNOPSIS
3+
Retrieves LogicMonitor account usage metrics from the API.
4+
5+
.DESCRIPTION
6+
The Get-LMUsageMetric cmdlet calls the `/metrics/usage` endpoint and returns the usage payload
7+
for your LogicMonitor portal (for example device counts and related usage figures). You must
8+
call Connect-LMAccount before using this cmdlet.
9+
10+
.EXAMPLE
11+
Get-LMUsageMetric
12+
13+
Retrieves current usage metrics for the connected portal.
14+
15+
.NOTES
16+
You must run Connect-LMAccount before running this command.
17+
18+
.INPUTS
19+
None. You cannot pipe objects to this cmdlet.
20+
21+
.OUTPUTS
22+
Returns the object returned by the LogicMonitor usage metrics API.
23+
24+
#>
125
function Get-LMUsageMetric {
226

327
[CmdletBinding(DefaultParameterSetName = 'All')]

Public/New-LMUptimeDevice.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ Specifies the request timeout in seconds for web check steps. Valid range is 1-3
100100
.PARAMETER FollowRedirection
101101
Indicates whether to follow HTTP redirects. Defaults to $true.
102102
103-
.PARAMETER Host
104-
Specifies the host or IP for ping checks. Required for ping parameter sets.
103+
.PARAMETER Hostname
104+
Specifies the hostname or IP address to ping. Required for ping parameter sets (**PingInternal** and **PingExternal**).
105105
106106
.PARAMETER Count
107107
Specifies ping attempts per collection for ping checks. Valid values: 5, 10, 15, 20, 30, 50.
@@ -132,12 +132,12 @@ New-LMUptimeDevice -Name "web-ext-01" -HostGroupIds 17 -Domain "app.example.com"
132132
Creates a new external web uptime check using the specified public locations.
133133
134134
.EXAMPLE
135-
New-LMUptimeDevice -Name "ping-int-01" -HostGroupIds 17 -Host "intranet.local" -TestLocationCollectorIds 5
135+
New-LMUptimeDevice -Name "ping-int-01" -HostGroupIds 17 -Hostname "intranet.local" -TestLocationCollectorIds 5
136136
137137
Creates an internal ping uptime check that targets intranet.local.
138138
139139
.EXAMPLE
140-
New-LMUptimeDevice -Name "ping-ext-01" -HostGroupIds 17 -Host "api.example.net" -TestLocationSmgIds 2,4
140+
New-LMUptimeDevice -Name "ping-ext-01" -HostGroupIds 17 -Hostname "api.example.net" -TestLocationSmgIds 2,4
141141
142142
Creates an external ping uptime check using the provided public locations.
143143

Public/Set-LMWebsite.ps1

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,39 @@ Available collector group IDs correspond to LogicMonitor regions:
6666
- 5 = Asia - Singapore
6767
- 6 = Australia - Sydney
6868
69+
.PARAMETER PingAddress
70+
Target hostname or IP address for **Ping** website checks (internal or external ping parameter set).
71+
72+
.PARAMETER WebsiteDomain
73+
Domain or URL host portion for **Website** checks (HTTP/HTTPS monitoring).
74+
75+
.PARAMETER HttpType
76+
HTTP scheme for website checks. Valid values: **http** or **https**.
77+
78+
.PARAMETER PingCount
79+
Number of ICMP echo requests per poll for ping checks. Valid values: 5, 10, 15, 20, 30, 50.
80+
81+
.PARAMETER PingTimeout
82+
Timeout in milliseconds for each ping request in ping checks.
83+
84+
.PARAMETER PageLoadAlertTimeInMS
85+
Maximum acceptable page load time in milliseconds before a website check raises an alert.
86+
87+
.PARAMETER PingPercentNotReceived
88+
Packet loss percentage threshold for ping checks. Valid values: 10 through 100 in tens.
89+
90+
.PARAMETER FailedCount
91+
Number of consecutive failed checks before alerting. Valid values: 1-10, 30, or 60.
92+
93+
.PARAMETER OverallAlertLevel
94+
Alert severity for overall website or ping check status. Valid values: **warn**, **error**, **critical**.
95+
96+
.PARAMETER IndividualAlertLevel
97+
Alert severity for individual step or probe failures. Valid values: **warn**, **error**, **critical**.
98+
99+
.PARAMETER WebsiteSteps
100+
Optional scripted steps for multi-step website checks (website parameter set).
101+
69102
.EXAMPLE
70103
Set-LMWebsite -Id 123 -Name "Updated Site" -Description "New description" -DisableAlerting $false
71104
Updates the website with new name, description, and enables alerting.
@@ -160,7 +193,7 @@ function Set-LMWebsite {
160193
[Nullable[Int]]$PollingInterval,
161194

162195
[Parameter(ParameterSetName = "Website")]
163-
[String[]]$WebsiteSteps,
196+
[Object[]]$WebsiteSteps,
164197

165198
[Nullable[boolean]]$TestLocationAll, #Only valid for external checks
166199

@@ -293,11 +326,11 @@ function Set-LMWebsite {
293326
testLocation = $testLocation
294327
}
295328

296-
297329
#Remove empty keys so we dont overwrite them
298330
$Data = Format-LMData `
299331
-Data $Data `
300332
-UserSpecifiedKeys $MyInvocation.BoundParameters.Keys `
333+
-ConditionalKeep @{ 'steps' = 'WebsiteSteps' } `
301334
-ConditionalValueKeep @{ 'PropertiesMethod' = @(@{ Value = 'Refresh'; KeepKeys = @('customProperties') }) } `
302335
-Context @{ PropertiesMethod = $PropertiesMethod }
303336

0 commit comments

Comments
 (0)