Monitor.Client 1.0.0

Monitor.Client

This is a simple console application that interacts with the Monitor.Client library to send system status messages and notifications.

Example Usage

Set up the Monitor Client

First the MonitorClient needs to be set up with the URL of the monitor service, the application name, and the system name. This is typically done at the start of your application.

Here we use the Resilient API connection to ensure that the client can handle transient errors gracefully.

var monitorUrl = "https://localhost:7277/";

var applicationName = "Monitor";
var systemName = "Client Demo";

// Start notifier
MonitorClient.Instance = new MonitorClientConnection(new ResilientApiConnection(monitorUrl), applicationName, systemName);

If you are not using the Monitor, you may set it to NoMonitorClient.

MonitorClient.Instance = NoMonitor.Client;

This way no errors will occur.

You also have the option to ignore configuration errors, like missing configuration

MonitorClient.IgnoreMissingConfiguration = true;

This will ignore configuration errors and allow the application to run without throwing exceptions related to the monitor configuration.

Please be aware that he method EnsureSystemExistsAsync will not work if the configuration is missing.

Sending a System Status Message

var message = "This is a message";
await MonitorClient.SetStatusSuccessAsync(CurrentStatus.Running, message);

For errors you can use:

await MonitorClient.SetStatusErrorAsync(CurrentStatus.Running, message);

Sending a Notification

var message = "This is a notification";
await MonitorClient.NotifyAsync(message);

Ensuring System Exists

await MonitorClient.EnsureSystemExistsAsync();

No packages depend on Monitor.Client.

.NET 9.0

Version Downloads Last updated
1.0.1 18 11/11/2025
1.0.0 2 11/11/2025
1.0.0-CI-20251111-152312 3 11/11/2025