HardwareExporterWeb
March 8, 2026 · View on GitHub
HardwareExporterWeb is an optional companion service for HardwareExporterWindows that provides automatic service discovery for Prometheus.
What It Does
HardwareExporterWeb is not a metrics collector - it's a service discovery tool that:
- 🔍 Automatically scans your local network to discover Windows machines
- 📡 Provides Prometheus HTTP Service Discovery endpoints
- 🌐 Offers a web interface to manage discovered hosts
- 🌍 Supports multiple languages (English, Chinese, Japanese)
Why Use It?
Instead of manually configuring each monitoring target in prometheus.yml:
# Manual configuration (tedious)
scrape_configs:
- job_name: 'windows-hardware'
static_configs:
- targets:
- '192.168.1.100:9888'
- '192.168.1.101:9888'
- '192.168.1.102:9888'
# ... add more manually
Use automatic service discovery:
# Automatic discovery (dynamic)
scrape_configs:
- job_name: 'windows-hardware-auto'
http_sd_configs:
- url: 'http://your-web-server/api/ServiceDiscovery/HardwareExporter'
refresh_interval: 60s
Installation
Prerequisites
- .NET 10.0 Runtime
- Network access to scan subnet
Quick Start
- Download
HardwareExporterWeb-win-x64.zipfrom the latest release - Extract to your desired location
- Edit
appsettings.json(optional) - Run
HardwareExporterWeb.exe
The web interface will be available at http://localhost:80 by default.
Configuration
Edit appsettings.json:
{
"NetworkScan": {
"SubnetFilter": "", // Empty = scan all local subnets
"SubnetMask": "255.255.255.0" // Subnet mask for scanning
},
"Kestrel": {
"Endpoints": {
"Http": {
"Url": "http://0.0.0.0:80"
}
}
}
}
Network Scan Options
| Option | Type | Default | Description |
|---|---|---|---|
SubnetFilter | string | "" | Optional subnet filter (e.g., "10.100.100"). Empty = scan all local subnets |
SubnetMask | string | "255.255.255.0" | Subnet mask for network scanning |
Examples
Scan all local subnets:
"SubnetFilter": ""
Scan specific subnet only:
"SubnetFilter": "10.100.100"
Use different subnet mask:
"SubnetMask": "255.255.0.0"
API Endpoints
Service Discovery
-
GET
/api/ServiceDiscovery/HardwareExporter- Returns list of discovered HardwareExporter instances
- Format: Prometheus HTTP SD compatible JSON
-
GET
/api/ServiceDiscovery/WindowsExporter- Returns list of discovered windows_exporter instances
- Format: Prometheus HTTP SD compatible JSON
Response Format
[
{
"targets": ["192.168.1.100:9888"],
"labels": {
"ip": "192.168.1.100",
"hostname": "DESKTOP-ABC123"
}
}
]
Prometheus Configuration
HTTP Service Discovery
scrape_configs:
- job_name: 'hardware-exporter-auto'
http_sd_configs:
- url: 'http://your-web-server/api/ServiceDiscovery/HardwareExporter'
refresh_interval: 60s
- job_name: 'windows-exporter-auto'
http_sd_configs:
- url: 'http://your-web-server/api/ServiceDiscovery/WindowsExporter'
refresh_interval: 60s
Web Interface
The web interface provides:
- 📊 View discovered hosts
- ➕ Manually add hosts
- ✏️ Edit host information
- 🗑️ Remove hosts
- 🌐 Multi-language support (EN/CN/JP)
Access the web interface at http://localhost:80 (or your configured port).
Language Support
The web interface supports three languages:
- 🇺🇸 English
- 🇨🇳 简体中文 (Simplified Chinese)
- 🇯🇵 日本語 (Japanese)
Use the language selector in the top-right corner to switch languages.
Architecture
┌─────────────────────────────────────┐
│ Prometheus Server │
│ (pulls from HTTP SD endpoints) │
└──────────────┬──────────────────────┘
│
│ HTTP SD API
│
┌──────────────▼──────────────────────┐
│ HardwareExporterWeb │
│ - Network Scanner │
│ - Host Manager │
│ - Web UI │
└──────────────┬──────────────────────┘
│
│ ARP Scan
│
┌──────────────▼──────────────────────┐
│ Local Network │
│ - Windows machines with │
│ HardwareExporter │
│ - Windows machines with │
│ windows_exporter │
└─────────────────────────────────────┘
Development
Building from Source
cd src/HardwareExporterWeb
dotnet build
Running in Development
cd src/HardwareExporterWeb
dotnet run
Running Tests
cd test/HardwareExporterWeb.Tests
dotnet test
Troubleshooting
Service not discovering hosts
- Check network connectivity
- Verify subnet configuration in
appsettings.json - Ensure target machines are running HardwareExporter or windows_exporter
- Check firewall rules allow network scanning
Web interface not accessible
- Check if port 80 is already in use
- Try changing the port in
appsettings.json - Verify firewall allows incoming connections
- Check application logs for errors
Prometheus not picking up targets
- Verify the HTTP SD URL is correct
- Check Prometheus logs for SD errors
- Test the API endpoint manually:
curl http://your-server/api/ServiceDiscovery/HardwareExporter - Ensure
refresh_intervalis set appropriately
License
MIT License - see LICENSE file for details.
Related Projects
- HardwareExporterWindows - The main hardware metrics exporter
- LibreHardwareMonitor - Hardware monitoring library
- Prometheus - Monitoring system and time series database
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.