![]() |
VOOZH | about |
dotnet add package LogicMonitor.PowerShell --version 3.237.11
NuGet\Install-Package LogicMonitor.PowerShell -Version 3.237.11
<PackageReference Include="LogicMonitor.PowerShell" Version="3.237.11" />
<PackageVersion Include="LogicMonitor.PowerShell" Version="3.237.11" />Directory.Packages.props
<PackageReference Include="LogicMonitor.PowerShell" />Project file
paket add LogicMonitor.PowerShell --version 3.237.11
#r "nuget: LogicMonitor.PowerShell, 3.237.11"
#:package LogicMonitor.PowerShell@3.237.11
#addin nuget:?package=LogicMonitor.PowerShell&version=3.237.11Install as a Cake Addin
#tool nuget:?package=LogicMonitor.PowerShell&version=3.237.11Install as a Cake Tool
This PowerShell module provides a wrapper around the LogicMonitor.Api .NET library, enabling you to interact with LogicMonitor's REST API using PowerShell cmdlets.
Import-Module .\LogicMonitor.PowerShell\bin\Debug\net9.0\LogicMonitor
Install-Module -Name LogicMonitor
Before using the module, you need to configure your LogicMonitor credentials:
# Connect to LogicMonitor
Connect-LogicMonitor -Account "yourcompany" -AccessId "your-access-id" -AccessKey "your-access-key"
# Get all monitored resources
$resources = Get-LMResource
# Get resources with specific filter
$webServers = Get-LMResource -Filter @{ Name = "*web*" }
# Get all active alerts
$alerts = Get-LMAlert
# Get critical alerts only
$criticalAlerts = Get-LMAlert -Level "critical"
# Get all dashboards
$dashboards = Get-LMDashboard
# Get specific dashboard by name
$dashboard = Get-LMDashboard -Name "Infrastructure Overview"
# Create a new resource
$newResource = New-LMResource -Name "MyServer" -DisplayName "My Server" -ResourceGroupId 1
# Update resource properties
Set-LMResourceProperty -ResourceId 123 -Name "custom.property" -Value "some value"
# Remove a resource
Remove-LMResource -ResourceId 123
# Get performance data
$data = Get-LMResourceData -ResourceId 123 -DataSourceName "CPU" -StartTime (Get-Date).AddHours(-1)
# Get raw data for specific instance
$rawData = Get-LMRawData -ResourceId 123 -DataSourceId 456 -InstanceId 789 -StartTime (Get-Date).AddDays(-1)
Connect-LogicMonitor - Establish connection to LogicMonitor APIDisconnect-LogicMonitor - Close connection to LogicMonitor APITest-LMConnection - Test current connection statusGet-LMResource - Retrieve resourcesNew-LMResource - Create new resourceSet-LMResource - Update resourceRemove-LMResource - Delete resourceGet-LMResourceGroup - Retrieve resource groupsNew-LMResourceGroup - Create new resource groupGet-LMAlert - Retrieve alertsSet-LMAlert - Update alert (acknowledge, etc.)Get-LMAlertRule - Retrieve alert rulesGet-LMDashboard - Retrieve dashboardsGet-LMDashboardGroup - Retrieve dashboard groupsGet-LMResourceData - Get performance dataGet-LMRawData - Get raw metric dataGet-LMGraphData - Get graph dataGet-LMUser - Retrieve usersNew-LMUser - Create new userSet-LMUser - Update userRemove-LMUser - Delete userGet-LMCollector - Retrieve collectorsGet-LMCollectorGroup - Retrieve collector groupsThe module provides consistent error handling with meaningful error messages:
try {
$resource = Get-LMResource -Id 999999
}
catch {
Write-Error "Failed to retrieve resource: $($_.Exception.Message)"
}
# Complex filtering
$filter = @{
Name = "*prod*"
Type = "Server"
Status = "Normal"
}
$resources = Get-LMResource -Filter $filter
# Process multiple resources
$resources = Get-LMResource -Filter @{ Group = "Production" }
foreach ($resource in $resources) {
Set-LMResourceProperty -ResourceId $resource.Id -Name "environment" -Value "prod"
}
Contributions are welcome! Please see the main repository for contribution guidelines.
This project is licensed under the MIT License - see the LICENSE file for details.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
v3.229.11:
- Now uses Nerdbank.GitVersioning for automatic versioning (synchronized with LogicMonitor.Api)
- Updated Microsoft.Extensions.Logging packages to 10.0.1
- Fixed logger disposal issue in cmdlets
- Underlying LogicMonitor.Api now supports JSON export/import for LogicModules