45 lines
1.5 KiB
Markdown
45 lines
1.5 KiB
Markdown
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. |