LogicMonitor.PowerShell 3.236.14

dotnet add package LogicMonitor.PowerShell --version 3.236.14
                    
NuGet\Install-Package LogicMonitor.PowerShell -Version 3.236.14
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="LogicMonitor.PowerShell" Version="3.236.14" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LogicMonitor.PowerShell" Version="3.236.14" />
                    
Directory.Packages.props
<PackageReference Include="LogicMonitor.PowerShell" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add LogicMonitor.PowerShell --version 3.236.14
                    
#r "nuget: LogicMonitor.PowerShell, 3.236.14"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package LogicMonitor.PowerShell@3.236.14
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=LogicMonitor.PowerShell&version=3.236.14
                    
Install as a Cake Addin
#tool nuget:?package=LogicMonitor.PowerShell&version=3.236.14
                    
Install as a Cake Tool

LogicMonitor PowerShell Module

This PowerShell module provides a wrapper around the LogicMonitor.Api .NET library, enabling you to interact with LogicMonitor's REST API using PowerShell cmdlets.

Installation

From Local Build

  1. Clone the repository
  2. Build the solution
  3. Import the module:
Import-Module .\LogicMonitor.PowerShell\bin\Debug\net9.0\LogicMonitor
Install-Module -Name LogicMonitor

Configuration

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"

Basic Usage Examples

Get All Resources

# Get all monitored resources
$resources = Get-LMResource

# Get resources with specific filter
$webServers = Get-LMResource -Filter @{ Name = "*web*" }

Get Alerts

# Get all active alerts
$alerts = Get-LMAlert

# Get critical alerts only
$criticalAlerts = Get-LMAlert -Level "critical"

Get Dashboards

# Get all dashboards
$dashboards = Get-LMDashboard

# Get specific dashboard by name
$dashboard = Get-LMDashboard -Name "Infrastructure Overview"

Resource Management

# 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

Data Collection

# 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)

Available Cmdlets

Connection Management

  • Connect-LogicMonitor - Establish connection to LogicMonitor API
  • Disconnect-LogicMonitor - Close connection to LogicMonitor API
  • Test-LMConnection - Test current connection status

Resource Management

  • Get-LMResource - Retrieve resources
  • New-LMResource - Create new resource
  • Set-LMResource - Update resource
  • Remove-LMResource - Delete resource
  • Get-LMResourceGroup - Retrieve resource groups
  • New-LMResourceGroup - Create new resource group

Alert Management

  • Get-LMAlert - Retrieve alerts
  • Set-LMAlert - Update alert (acknowledge, etc.)
  • Get-LMAlertRule - Retrieve alert rules

Dashboard Management

  • Get-LMDashboard - Retrieve dashboards
  • Get-LMDashboardGroup - Retrieve dashboard groups

Data Collection

  • Get-LMResourceData - Get performance data
  • Get-LMRawData - Get raw metric data
  • Get-LMGraphData - Get graph data

User Management

  • Get-LMUser - Retrieve users
  • New-LMUser - Create new user
  • Set-LMUser - Update user
  • Remove-LMUser - Delete user

Collector Management

  • Get-LMCollector - Retrieve collectors
  • Get-LMCollectorGroup - Retrieve collector groups

Error Handling

The module provides consistent error handling with meaningful error messages:

try {
    $resource = Get-LMResource -Id 999999
}
catch {
    Write-Error "Failed to retrieve resource: $($_.Exception.Message)"
}

Advanced Usage

Custom Filters

# Complex filtering
$filter = @{
    Name = "*prod*"
    Type = "Server"
    Status = "Normal"
}
$resources = Get-LMResource -Filter $filter

Bulk Operations

# Process multiple resources
$resources = Get-LMResource -Filter @{ Group = "Production" }
foreach ($resource in $resources) {
    Set-LMResourceProperty -ResourceId $resource.Id -Name "environment" -Value "prod"
}

Contributing

Contributions are welcome! Please see the main repository for contribution guidelines.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.236.14 32 4/11/2026
3.236.13 32 4/11/2026
3.236.8 37 4/7/2026
3.236.7 32 4/7/2026

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