Configure Server Monitoring

Set up real-time server metrics in your Blazor dashboard with BptServerMonitor.

Home / Getting Started / Server Monitoring

Overview

The BptServerMonitor component displays live CPU, GPU, memory, disk, and network metrics from one or more servers. It works with a lightweight monitoring service that runs on each target machine and pushes metrics to your Blazor app via SignalR.

Architecture
┌──────────────────┐ SignalR ┌─────────────────┐ │ Server Monitor │ ───────────────► │ Blazor Server │ │ Service (.exe) │ push metrics │ (your app) │ │ │ │ │ │ Runs on each │ │ BptServerMonitor│ │ target server │ │ component │ └──────────────────┘ └─────────────────┘ ▲ │ │ collects │ displays CPU, GPU, RAM, Real-time charts disk, network and gauges

Step 1: Install the Monitor Service

Install the BPT Server Monitor service on each server you want to monitor. The service collects system metrics using platform-native APIs.

Windows

Download and run the MSI installer. The service registers as a Windows service and starts automatically.

After installation, configure the hub URL in:

C:\Program Files\BptServerMonitor\appsettings.json
{ "ServerMonitor": { "HubUrl": "https://your-blazor-host/bpt-servermonitorhub", "ServerId": "my-windows-server", "IntervalMs": 2000 } }

Linux

Install the .deb package:

sudo dpkg -i bpt-servermonitor_1.0.0_amd64.deb

Configure and start:

# Edit configuration sudo nano /opt/bpt-servermonitor/appsettings.json # Start the service sudo systemctl start bpt-servermonitor # Enable on boot sudo systemctl enable bpt-servermonitor # Check status sudo systemctl status bpt-servermonitor

Step 2: Configure the Blazor Server Hub

In your Blazor server's Program.cs, map the SignalR hub that receives metrics:

var builder = WebApplication.CreateBuilder(args); // Add BPT services (includes the monitor hub) builder.Services.AddBlazorPowerTools(); var app = builder.Build(); // Map the server monitor hub endpoint app.MapBlazorPowerToolsHubs(); app.Run();
SignalR Configuration The monitor service pushes metric snapshots every few seconds. For multiple servers, make sure your SignalR configuration can handle the throughput. The default settings work well for up to 10 servers at 2-second intervals.

Step 3: Add the Monitor Component

Place BptServerMonitor on your admin dashboard page:

<BptServerMonitor ShowCPUMetrics="true" ShowGPUMetrics="true" ShowMemoryMetrics="true" ShowDiskMetrics="true" ShowNetworkMetrics="true" Servers="@servers" /> @code { private List<BptServerMonitorConfig> servers = new() { new() { FriendlyName = "Web Host", Domain = "localhost" }, new() { FriendlyName = "DB Server", Domain = "192.168.1.10" }, new() { FriendlyName = "GPU Node", Domain = "gpu-node.internal" } }; }

Component Parameters

Parameter Type Description
ServersList<BptServerMonitorConfig>List of servers to monitor
ShowCPUMetricsboolShow CPU usage, load, and temperature
ShowGPUMetricsboolShow GPU utilization and VRAM
ShowMemoryMetricsboolShow RAM usage and swap
ShowDiskMetricsboolShow disk space and I/O
ShowNetworkMetricsboolShow network throughput
RefreshIntervalintUI refresh rate in milliseconds (default: 2000)

Service Configuration Reference

Setting Description Default
HubUrlThe SignalR hub URL on your Blazor server(required)
ServerIdUnique identifier for this serverMachine hostname
IntervalMsHow often to push metrics (milliseconds)2000
EnableGpuCollect GPU metrics (requires NVML on Linux)true
EnableDiskCollect disk I/O metricstrue
EnableNetworkCollect network throughput metricstrue

Firewall & Networking

The monitor service makes outbound HTTPS connections to your Blazor server. Ensure:

  • The monitor service can reach the Blazor server's hostname on the configured port (typically 443)
  • No firewall rule blocks outbound HTTPS from the monitored server
  • If using a reverse proxy (nginx, IIS), ensure WebSocket upgrade headers are forwarded
  • For internal networks, consider using an internal DNS name or IP for the HubUrl
Tip Test connectivity from the monitored server before deploying the service:
curl -I https://your-blazor-host/bpt-servermonitorhub

An unhandled error has occurred. Reload 🗙

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please reload the page.