ZentrixLabs.PrtgSdk 1.0.12

dotnet add package ZentrixLabs.PrtgSdk --version 1.0.12
                    
NuGet\Install-Package ZentrixLabs.PrtgSdk -Version 1.0.12
                    
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="ZentrixLabs.PrtgSdk" Version="1.0.12" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ZentrixLabs.PrtgSdk" Version="1.0.12" />
                    
Directory.Packages.props
<PackageReference Include="ZentrixLabs.PrtgSdk" />
                    
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 ZentrixLabs.PrtgSdk --version 1.0.12
                    
#r "nuget: ZentrixLabs.PrtgSdk, 1.0.12"
                    
#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.
#addin nuget:?package=ZentrixLabs.PrtgSdk&version=1.0.12
                    
Install ZentrixLabs.PrtgSdk as a Cake Addin
#tool nuget:?package=ZentrixLabs.PrtgSdk&version=1.0.12
                    
Install ZentrixLabs.PrtgSdk as a Cake Tool

ZentrixLabs.PrtgSdk

NuGet Version NuGet Downloads GitHub

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, counts
  • Warning 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:

Buy Me A Coffee

Product 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. 
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
1.0.12 60 5/24/2025
1.0.4 55 5/24/2025
1.0.3 71 5/23/2025
1.0.2 76 5/23/2025
1.0.1 78 5/23/2025