This commit is contained in:
2025-12-25 20:02:01 +01:00
parent 41da0701ff
commit 65ceff6a9c
3 changed files with 50 additions and 13 deletions

View File

@@ -0,0 +1,45 @@
Infrastructure Monitor Dashboard Walkthrough
I have successfully created a real-time infrastructure monitor dashboard.
Features
Real-time Monitoring: Pings local servers (PC and Raspberry Pi) via SSH and web services via HTTP.
System Metrics: Displays CPU usage, RAM usage, Temperature, and Disk space for servers.
Premium UI: Modern, dark-themed dashboard with glassmorphism effects and dynamic charts.
Dockerized: Easy deployment using Docker Compose.
Components
Backend (FastAPI)
main.py
: Handles API requests and orchestrates monitoring tasks.
monitor_logic.py
: Contains the logic for SSH commands and web pings.
requirements.txt
: Python dependencies.
Frontend (HTML/JS)
monitor.html
: A single-page application that fetches data from the backend and updates the UI every minute.
Deployment
Dockerfile
: Build instructions for the container.
docker-compose.yml
: Service definition.
.env
: Environment variables for SSH passwords.
How to Deploy
Copy files to your cloud server: Copy the contents of the monitor directory to your server.
Run with Docker Compose:
docker-compose up -d --build
Update Caddyfile: Add the following to your Caddyfile:
asf.monitor.nabd-co.com {
reverse_proxy monitor-app:8000
}
Then reload Caddy:
docker exec caddy caddy reload --config /etc/caddy/Caddyfile
Verification
Access asf.monitor.nabd-co.com in your browser.
You should see the dashboard with real-time stats.
The "Web Services" section will show the status and latency of your services.
The PC and Raspberry Pi sections will show their health metrics.