Skip to content

biodland/ServerMonitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

27 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

ServerMonitor

C# .NET Linux

A modular, multi-vendor server monitoring & fan control system

Note: This project was previously called IPMIFanControl / DellFanControl. It has been refactored into a generic, extensible monitoring system that can support multiple server vendors. See DESIGN.md for the full architecture document.

Features

  • ๐Ÿ–ฅ๏ธ Multi-vendor support via a clean provider pattern with auto-detection
  • ๐ŸŒก๏ธ Real-time temperature monitoring (IPMI sensors + lm-sensors CPU cores)
  • ๐ŸŒ€ Fan control with manual / automatic modes and periodic re-application
  • โšก Power consumption monitoring
  • ๐ŸŽฎ GPU monitoring (NVIDIA via nvidia-smi, AMD via rocm-smi, Intel via sysfs)
  • ๐Ÿ“Š Live dashboard with charts and quick stats (5-second refresh)
  • ๐Ÿ“ˆ System Stats page โ€” CPU load, memory usage, per-NIC network throughput, filesystem & block-device I/O (2-second refresh)
  • ๐Ÿ”Œ REST API for integration & automation
  • ๐Ÿ” Auto-detection of server hardware via DMI/SMBIOS with provider fallback chain

Screenshots

Screenshot of Dashboard Screenshot of System Stats page

Currently supported hardware

Vendor Model Status
Dell R720 XD โœ… Implemented
Dell R740 XD โœ… Implemented
Dell R240 โœ… Implemented
Dell (Generic) โœ… Fallback
SuperMicro - ๐Ÿ”„ Planned
ASRock - ๐Ÿ”„ Planned
HPE - ๐Ÿ”„ Planned

Adding new providers requires only implementing IServerProvider / IServerProviderCandidate for the vendor/model.

Architecture

ServerMonitor/
โ”œโ”€โ”€ Core/                  # Domain interfaces, models, enums
โ”‚   โ”œโ”€โ”€ Enums/
โ”‚   โ”œโ”€โ”€ Interfaces/
โ”‚   โ””โ”€โ”€ Models/
โ”œโ”€โ”€ Infrastructure/        # External-system adapters
โ”‚   โ”œโ”€โ”€ Detection/         # DMI hardware detection + provider factory
โ”‚   โ”œโ”€โ”€ Gpu/               # nvidia-smi / rocm-smi / sysfs
โ”‚   โ”œโ”€โ”€ Ipmi/              # IpmiToolClient (ipmitool wrapper)
โ”‚   โ””โ”€โ”€ System/            # ShellExecutor, lm-sensors parser, LinuxSystemStatsCollector
โ”œโ”€โ”€ Providers/             # Vendor/model implementations
โ”‚   โ”œโ”€โ”€ ProviderBase/
โ”‚   โ””โ”€โ”€ Dell/
โ”œโ”€โ”€ Services/              # Application services / hosted services
โ”‚   โ”œโ”€โ”€ MetricsCollectorService
โ”‚   โ”œโ”€โ”€ SystemStatsService
โ”‚   โ””โ”€โ”€ FanControlService
โ”œโ”€โ”€ Controllers/           # MVC + API
โ”‚   โ”œโ”€โ”€ DashboardController
โ”‚   โ”œโ”€โ”€ StatsController
โ”‚   โ””โ”€โ”€ ApiController
โ””โ”€โ”€ Views/                 # Razor views
    โ”œโ”€โ”€ Dashboard/
    โ”œโ”€โ”€ Stats/
    โ””โ”€โ”€ Shared/

See DESIGN.md for the detailed architecture and the future native-IPMI roadmap.

Quick start

Prerequisites

sudo apt-get install ipmitool lm-sensors
sudo sensors-detect --auto

Note: ipmitool requires root privileges for in-band IPMI. Run the application with sudo or add the user to the appropriate group.

Configuration

Create appsettings.json (git-ignored by default) in the project root:

{
  "ServerMonitor": {
    "Server":     { "Port": 5000 },
    "Ipmi":       { "UseLocal": true },
    "FanControl": { "EnableControl": false, "ManualSpeed": 20, "CheckIntervalSeconds": 30 }
  }
}

For out-of-band IPMI (e.g. iDRAC over the network):

{
  "ServerMonitor": {
    "Ipmi": {
      "UseLocal": false,
      "Host": "192.168.0.101",
      "Username": "root",
      "Password": "your-idrac-password",
      "Interface": "lanplus",
      "CipherSuite": 3
    }
  }
}

You can also create appsettings.local.json for local overrides (also git-ignored).

Run

dotnet run

Open http://localhost:5000 to access the dashboard. The application will auto-detect your server hardware and select the appropriate provider at startup.

REST API

Method Path Description
GET /api/status Latest hardware metrics snapshot
GET /api/provider Active provider info & capabilities
GET /api/history Hardware metrics history for graphing
GET /api/test Test the IPMI / hardware connection
POST /api/fans/speed/{percent} Set manual fan speed (5-100%)
POST /api/fans/auto Restore automatic fan control
GET /api/stats Latest system stats (CPU/mem/net/disk)
GET /api/stats/history System stats history for graphing

System Stats

The /Stats page (also available at the top-level nav) shows:

  • CPU โ€” overall and per-core usage, load averages, user/system/iowait breakdown, model name
  • Memory โ€” total / used / available / cached / buffers, swap usage
  • Network โ€” per-interface status, link speed, IPv4 addresses, RX/TX rate, totals & errors
  • Storage volumes โ€” every mounted filesystem with size, free, used, and usage bar
  • Storage devices โ€” every block device (HDD/SSD) with size, R/W rate, model, and temperature when available

Filtering network interfaces

By default virtual interfaces (lo, veth*, br-*, docker*, virbr*, vnet*, tun*, tap*, wg*) are hidden. Override via configuration:

"ServerMonitor": {
  "Stats": {
    "Network": {
      "Include": [ "eno1", "eno2" ],
      "Exclude": [ "veth*", "br-*", "lo" ]
    }
  }
}

Both lists support * wildcards. If Include is set, only matching interfaces are shown; Exclude filters the remainder.

Fan control service

The FanControlService is an optional background service that periodically re-applies a fixed fan speed. This is useful because some BMCs revert to automatic control after a watchdog timeout. It is disabled by default; enable it in configuration:

"ServerMonitor": {
  "FanControl": {
    "EnableControl": true,
    "ManualSpeed": 20,
    "CheckIntervalSeconds": 30
  }
}

On graceful shutdown the service automatically restores automatic fan control.

Adding a new server provider

  1. Create a class in Providers/<Vendor>/ that derives from ServerProviderBase (or use DellProviderBase as a template for similar vendors).
  2. Implement Vendor, Model, IsSupported(ServerInfo), and the three monitor components (ITemperatureMonitor, IFanController, IPowerMonitor).
  3. Also implement IServerProviderCandidate (a marker interface that lets the factory enumerate candidates without conflicting with the singleton IServerProvider).
  4. Register it in Program.cs:
    builder.Services.AddSingleton<IServerProviderCandidate, MyVendorProvider>();
  5. The factory automatically picks the most specific matching provider for the detected hardware, falling back to generic providers.

You can also force a specific provider via configuration:

"ServerMonitor": {
  "ForceProvider": "R720XD"
}

Tools

StatsCheck โ€” a standalone CLI tool that prints system stats to the console, useful for verifying the collector works without running the web app:

dotnet run --project src/Tools/StatsCheck/StatsCheck.csproj

Roadmap

  • โœ… Phase 1 โ€” Modular refactor with provider pattern
  • โœ… Phase 2 โ€” Dell R740 XD / R240 providers, auto-detection, system stats
  • ๐Ÿ”„ Phase 3 โ€” SuperMicro / ASRock providers
  • ๐Ÿ”„ Phase 4 โ€” Thermal-curve fan control
  • ๐Ÿ”„ Phase 5 โ€” Persisted metrics history (SQLite/InfluxDB)
  • ๐Ÿ”„ Phase 6 โ€” Native IPMI implementation (replace the ipmitool dependency)

See DESIGN.md for full details.

License

MIT โ€” see LICENSE.

About

C# project for controlling the fan speed on a server supporting IPMI

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors