DIWOS.CronMonitor
6.2.10
dotnet add package DIWOS.CronMonitor --version 6.2.10
NuGet\Install-Package DIWOS.CronMonitor -Version 6.2.10
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="DIWOS.CronMonitor" Version="6.2.10" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DIWOS.CronMonitor" Version="6.2.10" />
<PackageReference Include="DIWOS.CronMonitor" />
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 DIWOS.CronMonitor --version 6.2.10
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: DIWOS.CronMonitor, 6.2.10"
#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 DIWOS.CronMonitor@6.2.10
#: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=DIWOS.CronMonitor&version=6.2.10
#tool nuget:?package=DIWOS.CronMonitor&version=6.2.10
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
DIWOS.CronMonitor
A small .NET client package for sending heartbeat pings to Cron Monitor.
Version
6.2.10.0
6 - Year of release
2 - Month of release
10 - .NET version
0 - Patch version
Install
Reference the package in your project:
<ItemGroup>
<PackageReference Include="DIWOS.CronMonitor" Version="1.0.0" />
</ItemGroup>
Configuration
Add a CronMonitor section to your appsettings.json:
{
"CronMonitor": {
"BaseUrl": "https://cron-monitor.com",
"PingPath": "/api/monitor/ping",
"PingWorker": {
"Token": "MonitorTokenForThisWorker",
"Interval": "00:01:00"
}
}
}
For multiple background services, use PingWorkers:
{
"CronMonitor": {
"BaseUrl": "https://cron-monitor.com",
"PingPath": "/api/monitor/ping",
"PingWorkers": [
{
"Token": "MonitorTokenForThisWorker",
"Interval": "00:01:00"
},
{
"Token": "MonitorTokenForAnotherWorker",
"Interval": "00:05:00"
}
]
}
}
DI registration
Register the client and options with dependency injection:
using DIWOS.CronMonitor;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddCronMonitorClient(builder.Configuration);
Or configure options in code:
using DIWOS.CronMonitor;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddCronMonitorClient(options =>
{
options.BaseUrl = "https://cron-monitor.com";
options.PingPath = "/api/monitor/ping";
});
Usage
Inject ICronMonitorClient and send a ping with your token string:
using DIWOS.CronMonitor;
public sealed class PingWorker(ICronMonitorClient client) : BackgroundService
{
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{
while (!stoppingToken.IsCancellationRequested)
{
await client.PingAsync("MonitorTokenForThisWorker", stoppingToken);
await Task.Delay(TimeSpan.FromMinutes(1), stoppingToken);
}
}
}
Background service
Register the hosted service and options:
using DIWOS.CronMonitor;
using DIWOS.CronMonitor.BgServices;
using Microsoft.Extensions.Hosting;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddCronMonitorClient(builder.Configuration);
builder.Services.AddCronMonitorPingBackgroundService(builder.Configuration);
Notes
- The token is sent as
text/plainin the POST body. BaseUrlandPingPathare validated during startup.- The client uses
HttpClientFactoryunder the hood. - It is safe to use because request URLs are controlled by the library consumer, not by the library itself.
| 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.2)
- Microsoft.Extensions.Http (>= 10.0.2)
- Microsoft.Extensions.Options (>= 10.0.2)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.2)
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 |
|---|---|---|
| 6.2.10 | 89 | 2/12/2026 |
6.2.10.0