Skip to content

Server power monitoring application that unifies power metrics collection from HPE iLO and Dell iDRAC BMCs.

License

Notifications You must be signed in to change notification settings

chargeditsolutionsllc/server-wattman

Repository files navigation

Server Wattman

License: MIT Node.js Version Docker

A high-performance monitoring solution for iLO and iDRAC server power consumption metrics, built with Next.js.

Table of Contents

Overview

Server Wattman provides real-time power consumption tracking for your server infrastructure through HP iLO and Dell iDRAC interfaces.

Features

  • Real-time power consumption monitoring
  • Support for HP iLO and Dell iDRAC interfaces
  • Unified dashboard for multiple servers
  • Dark mode support
  • Redis-powered caching
  • Rate limiting and throttling
  • Structured logging
  • Health monitoring
  • API key authentication

Architecture

Technology Stack

  • Frontend: Next.js 14, React 18, TailwindCSS
  • Backend: Node.js 20
  • Caching: Redis 7
  • Containerization: Docker
  • SSL/TLS: HTTPS-Portal with Let's Encrypt

Getting Started

Prerequisites

  • Node.js 20 or later
  • Docker Engine 24.0+
  • Docker Compose v2
  • Git

Installation

  1. Clone and setup:
git clone https://github.com/yourusername/server-power-monitor.git
cd server-power-monitor
npm install
  1. Configure environment:
cp .env.example .env
chmod +x scripts/setup-dev.sh
./scripts/setup-dev.sh

Configuration

Create a .env file:

API_KEY=your-secure-api-key
REDIS_URL=redis://redis:6379
SERVER_CONFIGS_PATH=/path/to/config.json
DOMAINS=yourdomain.com
STAGE=production

Configure servers in JSON:

{
  "servers": [
    {
      "name": "server1",
      "type": "iLO",
      "ip": "10.0.0.1",
      "username": "admin",
      "password": "secure-password"
    }
  ]
}

API Documentation

Authentication

API endpoints require an API key in the X-API-Key header:

curl -H "X-API-Key: your-api-key" https://your-domain.com/api/health

Endpoints

Health Check

GET /api/health

{
  "status": "healthy",
  "timestamp": "2025-02-09T20:52:23.000Z",
  "version": "1.0.0",
  "services": {
    "redis": { "status": "connected" },
    "serverMonitoring": {
      "totalServers": 10,
      "onlineServers": 10
    }
  }
}

Server Power Data

GET /api/servers/{serverId}/power

{
  "serverId": "server1",
  "timestamp": "2025-02-09T20:52:23.000Z",
  "currentPower": 120,
  "averagePower": 115,
  "peakPower": 150
}

Security

  • API key authentication
  • Rate limiting per client
  • CORS protection
  • Automatic SSL certificate management
  • Input validation
  • Error sanitization

Monitoring

  • Health check endpoint at /api/health
  • Redis health monitoring (10s interval)
  • Memory usage tracking
  • Response time monitoring
  • Error rate tracking

Troubleshooting

  1. Redis Connection Failed

    • Check: docker compose ps
    • Verify Redis URL in .env
  2. iLO/iDRAC Connection Timeout

    • Verify server IP accessibility
    • Check firewall settings
  3. Rate Limiting Errors

    • Adjust RATE_LIMIT settings in .env

Debug mode:

DEBUG=true npm run dev

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Open a Pull Request

License

MIT License

About

Server power monitoring application that unifies power metrics collection from HPE iLO and Dell iDRAC BMCs.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published