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}");
}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
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);For more information on the LogicMonitor REST API, see the official documentation.
This project is licensed under the MIT License - see the LICENSE file for details.