LogicMonitor.Api 3.240.56

There is a newer version of this package available.
See the version list below for details.
dotnet add package LogicMonitor.Api --version 3.240.56
                    
NuGet\Install-Package LogicMonitor.Api -Version 3.240.56
                    
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.Api" Version="3.240.56" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LogicMonitor.Api" Version="3.240.56" />
                    
Directory.Packages.props
<PackageReference Include="LogicMonitor.Api" />
                    
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.Api --version 3.240.56
                    
#r "nuget: LogicMonitor.Api, 3.240.56"
                    
#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.Api@3.240.56
                    
#: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.Api&version=3.240.56
                    
Install as a Cake Addin
#tool nuget:?package=LogicMonitor.Api&version=3.240.56
                    
Install as a Cake Tool

LogicMonitor.Api

The LogicMonitor REST API nuget package, authored by Panoramic Data Limited.

Nuget Nuget License: MIT Codacy Badge

If you want some LogicMonitor software developed, come find us at: https://www.panoramicdata.com/ !

To get started, watch the videos here:

http://www.panoramicdata.com/products/logicmonitor-api-nuget-package/

A simple example:

using LogicMonitor.Api;

[...]

public static async Task GetAllResources(ILogger logger, CancellationToken cancellationToken)
{
	using var logicMonitorClient = new LogicMonitorClient(
		new LogicMonitorClientOptions
		{
			Account = "acme",
			AccessId = "accessId",
			AccessKey = "accessKey",
			Logger = logger
		}
	);

	var resources = await logicMonitorClient
		.GetAllAsync<Resource>(cancellationToken)
		.ConfigureAwait(false);

	Console.WriteLine($"Resource Count: {resources.Count}");
}

LogicModule Export/Import (JSON Format)

The modern LogicMonitor UI exports LogicModules to JSON format. This library supports both JSON and XML export/import:

// Export a DataSource as JSON (modern UI format)
var json = await logicMonitorClient
	.GetDataSourceJsonAsync(dataSourceId, cancellationToken);

// Export a DataSource as XML (legacy format)
var xml = await logicMonitorClient
	.GetDataSourceXmlAsync(dataSourceId, cancellationToken);

// Generic export by LogicModuleType
var json = await logicMonitorClient
	.GetLogicModuleJsonAsync(LogicModuleType.DataSource, dataSourceId, cancellationToken);

// Export to a file
await logicMonitorClient
	.ExportLogicModuleToJsonFileAsync(
		LogicModuleType.DataSource,
		dataSourceId,
		"datasource.json",
		cancellationToken);

// Import from JSON string
var imported = await logicMonitorClient
	.ImportDataSourceJsonAsync(json, cancellationToken);

// Import from file
var imported = await logicMonitorClient
	.ImportDataSourceFromJsonFileAsync("datasource.json", cancellationToken);

Supported LogicModule types for export/import:

  • DataSource
  • EventSource
  • ConfigSource
  • PropertySource
  • TopologySource
  • JobMonitor
  • AppliesToFunction

NEW! Uptime Resources (LM Uptime ping & web checks)

LM Uptime is LogicMonitor's replacement for the legacy Websites product. This library provides a strongly-typed surface for creating and managing internal/external ping and web checks as first-class resources. See docs/UptimeResources.md for a detailed guide, including how it is backed by Resources and custom properties.

using LogicMonitor.Api.Resources.Uptime;

var pingCheck = await logicMonitorClient.CreateAsync(
    new PingCheckResourceCreationDto
    {
        Name = "dns-google-ping",
        HostName = "8.8.8.8",
        PreferredCollectorId = collectorId,
        SyntheticsCollectorIds = [collectorId],
        TestLocation = new UptimeTestLocation { CollectorIds = [collectorId] }
    },
    cancellationToken);

var fetched = await logicMonitorClient.GetAsync<PingCheckResource>(pingCheck.Id, cancellationToken);

API Documentation

For more information on the LogicMonitor REST API, see the official documentation.

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 (4)

Showing the top 4 NuGet packages that depend on LogicMonitor.Api:

Package Downloads
LogicMonitor.Datamart

LogicMonitor Datamart

LogicMonitor.Cli

Creates a template LogicMonitor project for .NET. To install (or update) the template, type: dotnet new install LogicMonitor.Cli If you do not specify the namespace with --name, the folder name is used instead Once installed, go to an empty folder and type: dotnet new logicmonitor [--name Project.Namespace] Then modify the appsettings.json file to include your LogicMonitor account, Access Id and Access Key. After this, build and run with: dotnet run This should provide some basic information about your LogicMonitor account to demonstrate a working project.

Serilog.Sinks.LogicMonitor

Serilog sink for LogicMonitor's LM Logs

LogicMonitor.PowerShell

A PowerShell module wrapper for the LogicMonitor.Api .NET library

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.240.82 111 9/7/2026
3.240.79 97 9/7/2026
3.240.71 85 9/5/2026
3.240.67 82 9/4/2026
3.240.64 80 9/4/2026
3.240.61 78 9/4/2026
3.240.56 110 8/30/2026
3.240.46 321 8/28/2026
3.240.39 154 8/19/2026
3.240.34 174 8/11/2026
3.240.33 145 7/25/2026
3.240.32 122 7/25/2026
3.240.31 282 7/23/2026
3.240.30 173 7/23/2026
3.240.29 124 7/23/2026
3.240.27 226 7/23/2026
3.240.24 142 7/22/2026
3.240.20 174 7/6/2026
3.240.19 138 7/5/2026
3.240.14 163 7/3/2026
Loading failed

v3.240.46:
- Fixed: EscalationChainCreationDto no longer blanks its own destination lists. It carried
 four destination properties - the two names the API honours on write (destinations,
 ccDestinations) and the two the read model returns (destination, ccdestination). All four
 defaulted to an empty list rather than null, and NullValueHandling.Ignore only skips nulls,
 so every create serialised all four. Populating the read-shaped property sent recipients
 under ccdestination AND an empty ccDestinations; the API took the empty one and returned
 HTTP 200 with a fully-formed chain and no CC recipients - silent data loss visible only on
 a re-read. The read-shaped names are now non-serialising [Obsolete] aliases forwarding to
 the canonical properties, so existing code keeps compiling and starts working.
- Added: PatchResourceDataSourceInstanceAsync, plus SetResourceDataSourceInstanceAlertingAsync
 and SetResourceDataSourceInstanceMonitoringAsync (id and instance overloads), for writing
 individual fields on a resource DataSource instance. The pre-existing
 UpdateResourceDataSourceInstanceAsync is a full PUT that sends back every field it was
 handed; per-instance alert suppression is normally applied in bulk, where that is both
 wasteful and a clobbering risk.

v3.240.39:
- Changed: LogItemExtensions.MaxRegexDescriptionLength (the maximum LogItem description
 length processed by ToAuditEvent's regular expressions) is now public, so consumers can
 report the limit when logging size-skipped messages, and raised from 16,384 to 32,768
 characters. Real-world "Found new instance(s)" audit messages with a few hundred
 instances exceed 16K and were being skipped; the 5-second per-regex evaluation timeout
 remains the protection against pathological messages.

v3.240.34:
- Fixed: GetTopologyDataAsync no longer throws on vertex types the DataVertexType enum does
 not model. "Wireless" (any access point) is now a member, "Unknown" is accepted in either
 case, and the enum uses TolerantStringEnumConverter so a vertex type LogicMonitor adds in
 future degrades to DataVertexType.Unknown instead of failing the whole /topology/data call.

v3.240.27:
- Fixed: IntegrationMetadata.LogicModuleType no longer throws on values the enum's
 TolerantStringEnumConverter already knows how to handle (e.g. "SNMP_SYSOID_MAP" for
 SnmpSysOIDMap). A member-level [JsonConverter(StringEnumConverter)] on that property
 was silently overriding the enum's tolerant converter, causing DatamartClient calls
 touching installationMetadata.logicModuleType to fail deserialization.