ZentrixLabs.PrtgSdk
1.0.12
dotnet add package ZentrixLabs.PrtgSdk --version 1.0.12
NuGet\Install-Package ZentrixLabs.PrtgSdk -Version 1.0.12
<PackageReference Include="ZentrixLabs.PrtgSdk" Version="1.0.12" />
<PackageVersion Include="ZentrixLabs.PrtgSdk" Version="1.0.12" />
<PackageReference Include="ZentrixLabs.PrtgSdk" />
paket add ZentrixLabs.PrtgSdk --version 1.0.12
#r "nuget: ZentrixLabs.PrtgSdk, 1.0.12"
#addin nuget:?package=ZentrixLabs.PrtgSdk&version=1.0.12
#tool nuget:?package=ZentrixLabs.PrtgSdk&version=1.0.12
ZentrixLabs.PrtgSdk
A clean, lightweight .NET 9 SDK for working with the PRTG Network Monitor API.
Features
- ð Auth via PRTG API token
- ðĄ Fetch devices and sensors
- ð§ Sensor classification and formatting
- ðĶ Handles pagination and throttling
- ðŠķ Minimal dependencies, logging via
ILogger<T>
Security & Auth Notes
This SDK uses PRTG API v1, which authenticates via API token passed in the query string.
- â Best used with a dedicated, read-only PRTG user account.
- ð Ensure HTTPS is enabled on your PRTG server.
- ðŦ Do not log full request URLs â the SDK redacts API tokens in debug logs.
- âąïļ All HTTP requests enforce a timeout and avoid blocking indefinitely.
For session-based auth with bearer tokens (API v2), use a different integration â this SDK is intentionally optimized for unattended, background service use.
Installation
This SDK is designed for internal use but may be published to NuGet in the future.
Configuration
{
"PRTG": {
"BaseUrl": "https://prtg.example.com",
"ApiToken": "your_token_here"
}
}
You may also call .Validate()
on PrtgOptions
to ensure required fields are set and well-formed.
Bind this config using:
builder.Services.Configure<PrtgOptions>(builder.Configuration.GetSection("PRTG"));
builder.Services.AddHttpClient<PrtgService>();
Usage
var devices = await prtgService.GetAllDevicesWithGroupsAsync();
var sensors = await prtgService.GetSensorsByDeviceIdAsync(device.ObjectId);
Logging
All operations use ILogger<T>
:
Debug
level for API calls, pagination, countsWarning
for non-success responses
If logging full sensor or device payloads, use .SanitizeForLog()
to redact diagnostic fields like Message
, Status
, or names.
ð More from ZentrixLabs
Explore our tools, apps, and developer blog at zentrixlabs.net
Licensed under the MIT License by ZentrixLabs.
Contributing
Pull requests are welcome!
Please fork the repository, make your changes, and submit a pull request.
Ensure changes are well-tested and align with the SDK's goals of clarity, reliability, and minimalism.
If you'd like to support this project:
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
-
net9.0
- Microsoft.Extensions.Configuration (>= 9.0.5)
- Microsoft.Extensions.Configuration.Binder (>= 9.0.5)
- Microsoft.Extensions.Logging (>= 9.0.5)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.