LogicMonitor.Api
3.240.79
See the version list below for details.
dotnet add package LogicMonitor.Api --version 3.240.79
NuGet\Install-Package LogicMonitor.Api -Version 3.240.79
<PackageReference Include="LogicMonitor.Api" Version="3.240.79" />
<PackageVersion Include="LogicMonitor.Api" Version="3.240.79" />
<PackageReference Include="LogicMonitor.Api" />
paket add LogicMonitor.Api --version 3.240.79
#r "nuget: LogicMonitor.Api, 3.240.79"
#:package LogicMonitor.Api@3.240.79
#addin nuget:?package=LogicMonitor.Api&version=3.240.79
#tool nuget:?package=LogicMonitor.Api&version=3.240.79
LogicMonitor.Api
The LogicMonitor REST API nuget package, authored by Panoramic Data Limited.
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 | Versions 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. |
-
net10.0
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.11)
- Newtonsoft.Json (>= 13.0.4)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on LogicMonitor.Api:
| Package | Downloads |
|---|---|
|
LogicMonitor.Datamart
LogicMonitor Datamart |
|
|
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 | 81 | 9/7/2026 |
| 3.240.79 | 73 | 9/7/2026 |
| 3.240.71 | 64 | 9/5/2026 |
| 3.240.67 | 62 | 9/4/2026 |
| 3.240.64 | 60 | 9/4/2026 |
| 3.240.61 | 56 | 9/4/2026 |
| 3.240.56 | 110 | 8/30/2026 |
| 3.240.46 | 312 | 8/28/2026 |
| 3.240.39 | 152 | 8/19/2026 |
| 3.240.34 | 173 | 8/11/2026 |
| 3.240.33 | 144 | 7/25/2026 |
| 3.240.32 | 122 | 7/25/2026 |
| 3.240.31 | 279 | 7/23/2026 |
| 3.240.30 | 172 | 7/23/2026 |
| 3.240.29 | 124 | 7/23/2026 |
| 3.240.27 | 224 | 7/23/2026 |
| 3.240.24 | 141 | 7/22/2026 |
| 3.240.20 | 173 | 7/6/2026 |
| 3.240.19 | 137 | 7/5/2026 |
| 3.240.14 | 163 | 7/3/2026 |
v3.240.79:
- Added: GetResourcesByResourceGroupFullPathAsync now accepts an optional Filter<Resource>,
so callers can request only the fields they read. The per-group method it delegates to already
accepted a filter; the full-path wrapper hard-coded null, which made the capability unreachable
from the path-based entry point. Measured on a live portal, narrowing a device count to id and
resourceType: identical count and an identical number of API calls, with downlink bytes falling
from 4,585,963 to 527,259 - 8.7x less data for the same answer. Note this cannot reduce the
number of requests, which is one per group, so the saving is payload and memory rather than
latency. Purely additive: the parameter is optional and trailing, so existing callers are
unaffected and null preserves the previous behaviour exactly.
- Fixed: Resource did not model dedicatedLogCollectorGroupId or
isPreferredLogCollectorGroupConfigured, both of which LogicMonitor returns on
device/groups/{id}/devices. In DEBUG, where MissingMemberHandling is Error, deserialising any
resource list from such a portal threw. Release builds ignore unknown members, so no consumer
of the published package was affected.
- Fixed: Resource modelled lastRawdataTime as "lastRawDataTime", with a capital D the portal does
not use, and the portal never sends the model's spelling. Release builds bound it anyway through
Newtonsoft's case-insensitive fallback, so again no consumer was affected, but the DEBUG suite
failed and IsPropertyReadOnly(name, type, tryJsonNameFirst: true) threw PropertyNotFoundException
for the name the portal actually sends. Correcting the name also removes the library's reliance
on that fallback, which disappears if MissingMemberHandling is ever tightened in Release.
- Added: ResourceModelDriftTests, which fetches a page of resources as a raw JObject, unions the
field names across the page and diffs them against Resource's DataMember names. The three model
gaps above were each discovered by a separate live test run, one field at a time, with no way to
know how many remained; this reports every gap at once and distinguishes a field that is absent
from one that is merely miscased, which need different fixes.