aboutsummaryrefslogtreecommitdiffstats

Server Monitoring Dashboard

A lightweight monitoring dashboard for servers with JWT authentication and real-time metrics.

Features

  • Real-time system metrics display
  • Application performance monitoring
  • Service status monitoring
  • Secure JWT authentication
  • Responsive web interface

Requirements

  • Python 3.6+
  • Dependencies:
  • PyJWT
  • (Optional) python-dotenv for .env file support

Installation

  1. Clone this repository
  2. Install dependencies:
pip install PyJWT
pip install python-dotenv  # Optional but recommended

Configuration

You can configure the application using environment variables or by creating a .env file in the project root directory.

Create a .env file in the project root with the following variables:

# Security
JWT_SECRET=your_secret_jwt_key
AUTH_PASSWORD=your_secure_password

# Server Configuration
SERVER_PORT=8000
JWT_EXPIRATION_HOURS=8

# SNMP Configuration
SNMP_HOST=127.0.0.1
SNMP_COMMUNITY=your_snmp_community_string
SNMP_VERSION=2c
SNMP_COLLECTION_INTERVAL=10

Using Environment Variables

Alternatively, you can set the environment variables directly:

export JWT_SECRET=your_secret_jwt_key
export AUTH_PASSWORD=your_secure_password
export SERVER_PORT=8000
# ... and so on

Security Notes

  • JWT_SECRET: Should be a random, secure string. You can generate one using: python python -c "import secrets; print(secrets.token_hex(32))"
  • AUTH_PASSWORD: Choose a strong password to protect your metrics dashboard
  • If no JWT_SECRET is provided, a random one will be generated at startup (not recommended for production)
  • If no AUTH_PASSWORD is provided, a random one will be generated and displayed at startup

Running the Server

python server.py

The server will start and display the URL where you can access the dashboard.

Accessing the Dashboard

  1. Navigate to the server URL in your browser (default: http://localhost:8000)
  2. Click "View Server Metrics"
  3. Enter the password configured in AUTH_PASSWORD
  4. View your real-time metrics

License

MIT License