No description
Find a file
2026-04-14 15:51:43 +02:00
.streamlit feat: implement local Intelligent Infrastructure Agent using Gemma 3 4B and Ollama 2026-02-17 17:26:30 +02:00
.gitignore feat: implement async data collection, predictive capacity analysis, and advanced real-time dashboard UI 2026-03-01 12:11:32 +02:00
ai_agent.py feat: improve monitoring dashboard data refresh 2026-04-14 15:51:43 +02:00
auth_helper.py feat: Add Local Data Analyst Chatbot with optimized context and Ollama support 2026-02-16 13:26:21 +02:00
background_job.py feat: improve monitoring dashboard data refresh 2026-04-14 15:51:43 +02:00
data_collector.py feat: improve monitoring dashboard data refresh 2026-04-14 15:51:43 +02:00
database.py feat: improve monitoring dashboard data refresh 2026-04-14 15:51:43 +02:00
GEMINI.md feat: enhance dashboard with real-time fragments, manual IP unreserve, and refined state management 2026-02-25 14:47:50 +02:00
image.png Refactor auth logic, implement Dark Mode with classic IP grid, and overhaul UI/UX 2026-01-04 15:47:52 +02:00
models.py feat: improve monitoring dashboard data refresh 2026-04-14 15:51:43 +02:00
monitoring_dashboard.py feat: improve monitoring dashboard data refresh 2026-04-14 15:51:43 +02:00
README.md feat: enhance dashboard with real-time fragments, manual IP unreserve, and refined state management 2026-02-25 14:47:50 +02:00
requirements.txt feat: implement async data collection, predictive capacity analysis, and advanced real-time dashboard UI 2026-03-01 12:11:32 +02:00
SCHEMA_DESIGN.md Refactor: Implement persistent DB, multi-stage smart scanning, and history tracking. 2026-02-09 10:42:58 +02:00

ESXi Monitoring Dashboard

A lightweight, real-time monitoring and IP management solution for VMware ESXi environments. Built with Streamlit, SQLite, and pyVmomi.

🚀 Features

  • Host Overview: Visualized resource usage (CPU, RAM, Storage) across multiple ESXi hosts.
  • VM Inventory: Track Virtual Machines, their guest operating systems, IP addresses, hardware configurations, and power states.
  • IP Management (IPAM): An interactive visual heatmap of network subnets showing live (pingable) vs. available IP addresses.
  • Recent VM Tracking: Quickly identify VMs created within a specific date range.
  • Role-Based Access Control: Secure authentication for 'Admin' and 'User' roles.

🛠️ How It Works

  1. Data Collection: The data_collector.py module uses the pyVmomi library to interface with VMware's vSphere API. It retrieves hardware metrics and VM snapshots from configured hosts.
  2. Network Scanning: The application performs multi-threaded ICMP (ping) scans across defined subnets to populate the IP Management grid.
  3. Persistence: Data is stored in a local SQLite database (monitoring.db). This ensures the dashboard remains fast and responsive by serving cached data, which is periodically updated.
  4. Frontend: The UI is built using Streamlit, featuring a modern theme inspired by the IBM Carbon Design System.

📦 Installation

1. Prerequisites

  • Python 3.9+
  • Network access to ESXi hosts (Port 443).

2. Setup

Clone the repository and install the required dependencies:

pip install -r requirements.txt

3. Configuration

  1. Environment Variables: Create a .env file in the root directory to store your ESXi host passwords:

    GROUP1_PASS=your_password_here
    GROUP2_PASS=your_password_here
    
  2. User Config: The application requires a users.json file for authentication.

    • First Run: If this file is missing, create a generic one manually or use the snippet below.
    Click to copy default users.json content
    {
        "cookie": {
            "expiry_days": 30,
            "key": "random_signature_key",
            "name": "auth_cookie"
        },
        "credentials": {
            "usernames": {
                "admin": {
                    "name": "Admin",
                    "password": "$2b$12$vFNrfXSy86Xn1khBV6QJHOzhxmFzCCNTops./G1F/csKcRFOq7vg6",
                    "role": "admin"
                }
            }
        }
    }
    
    ``` *The default password for the above config is `admin`.*

    Session Expiration Configuration

    To configure how long a user stays logged in, modify the expiry_days value in users.json.

    • 8 Hours: 0.333333 (8/24)
    • 1 Day: 1
    • 30 Days: 30
    • 1 Minute (Testing): 0.000694

🚦 Usage

Start the Application

Run the Streamlit application to launch the dashboard:

streamlit run monitoring_dashboard.py
  • Default credentials: admin / admin
  • Access the dashboard at http://localhost:8501

Background Data Collection

To keep data fresh, run the background worker in a separate terminal:

python background_job.py

🔒 Security

  • Sensitive files (.env, monitoring.db, users.json, logos) are excluded from version control via .gitignore.
  • Password hashing is used for dashboard user accounts via streamlit-authenticator.

🤖 Intelligent Infrastructure Agent

The application includes a state-of-the-art AI Infrastructure Agent that allows you to query your ESXi environment using natural language. It translates your questions directly into optimized SQL queries and executes them against the local database.

🧠 Core Engine

The agent is powered by Gemini 2.0 Flash, a high-performance, low-latency model from Google.

🛠️ Setup

  1. API Key: Obtain a Gemini API key from Google AI Studio.
  2. Configuration: You can either:
    • Set the GEMINI_API_KEY environment variable in your .env file.
    • Enter the API key directly in the application's sidebar under the AI Infrastructure Agent page.

💡 Example Queries

  • "How many Cognos machines are powered on?"
  • "List all VMs on host 192.168.1.5"
  • "Which VMs have more than 4 vCPUs?"
  • "Find all Windows servers in the Production group"

Performance Features

  • Direct SQL Execution: Eliminates "hallucinations" by querying the ground truth database.
  • Context Awareness: Deeply understands the relationships between physical hosts and virtual guests.
  • Hybrid Search: Automatically resolves natural language terms to actual database values before querying.