Going to be adding Pi-hole integration.
web-based dashboard for monitoring Raspberry Pi 5 system metrics in real-time. Perfect for educational demonstrations and system administration.
Over the last few years, I’ve been tinkering with Raspberry Pis and using them for various purposes, and all of them are running headless. This can make it difficult to monitor them, so I decided it would be fun to create a local web page to provide a faster way to check and see what’s going on with my Pis.
SMART data is not available for microSD cards because they lack the firmware and controller logic to track and report health metrics like hard drives or SSDs. To monitor SD card health, you need to rely on indirect methods such as checking for read/write errors, monitoring performance, or running file system checks. However, if you are using an SSD, SMART should work — but not tested
- Real-time temperature tracking with visual gauge
- Per-core CPU usage display
- Current, minimum, and maximum clock frequencies
- CPU voltage monitoring
- Throttling detection and alerts
- Under-voltage detection
- Frequency capping alerts
- Thermal throttling status
- Real-time throttling warnings
- RAM usage with detailed breakdown (used, available, cached)
- Swap usage tracking
- Excessive swap detection and alerts
- Memory pressure indicators
- Multi-partition disk space visualization
- Used/Free/Total storage display
- Filesystem type information
- Disk I/O performance metrics
- Read/Write operation counts
- Read/Write throughput (MB)
- Read/Write time metrics
- S.M.A.R.T data display (if available)
- Device health status
- Temperature monitoring per device
- Power-on hours tracking
- Bad sector detection
- Read error rate monitoring
- Hostname and system details
- Uptime display
- Boot time information
- Release and machine information
- Raspberry Pi 5
- Python 3.7+
- Virtual environment (recommended)
- Network access (optional, for remote access)
cd /home/pi/Local-Host-Dashboardpython3 -m venv venv
source venv/bin/activatepip install --upgrade pip
pip install -r requirements.txtFor S.M.A.R.T data monitoring:
sudo apt-get update
sudo apt-get install smartmontoolspython run.pyThe dashboard will start on http://localhost:5002
python run.py --host 0.0.0.0 --port 5000Then access it from another computer on the network:
http://<raspberry-pi-ip>:5002
Local access only:
python run.py --host 127.0.0.1Network-accessible on custom port:
python run.py --host 0.0.0.0 --port 8080Debug mode for development:
python run.py --debugThe dashboard provides a clean, professional interface organized into sections:
- System hostname
- Current uptime
- Last update timestamp
- Operating system details
- Machine architecture
- Boot time
- System release information
- Temperature gauge (color-coded: green/yellow/red)
- Average CPU usage bar chart
- Per-core usage breakdown
- Current/Min/Max frequencies
- Voltage display
- Throttling status indicators
- RAM usage with breakdown (used, available, cached)
- Swap usage tracking
- Excessive swap alerts
- Visual progress bars with color coding
- Disk partition overview with usage percentages
- Free/Used/Total space per partition
- I/O performance statistics
- Read/Write operation counts and throughput
- S.M.A.R.T device information
- Health status (PASSED/FAILED/UNKNOWN)
- Temperature per device
- Power-on hours and error metrics
- Bad sector tracking
Create /etc/systemd/system/dashboard.service:
[Unit]
Description=Local Host Dashboard
After=network.target
[Service]
Type=simple
User=pi
WorkingDirectory=/home/pi/Local-Host-Dashboard
Environment="PATH=/home/pi/Local-Host-Dashboard/venv/bin"
ExecStart=/home/pi/Local-Host-Dashboard/venv/bin/python run.py --host 0.0.0.0
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.targetThen enable and start:
sudo systemctl daemon-reload
sudo systemctl enable dashboard
sudo systemctl start dashboard
sudo systemctl status dashboardTo view logs:
sudo journalctl -u dashboard -f- Some metrics may require elevated privileges
- S.M.A.R.T data requires
smartctlto be installed - Temperature readings require
/sys/class/thermalorvcgencmdaccess
- Run with
sudofor full access to throttling and thermal data - Or add your user to appropriate groups:
sudo usermod -a -G video $USER
- Make sure virtual environment is activated
- Reinstall requirements:
pip install -r requirements.txt
- Ensure firewall allows port 5000 (or your chosen port)
- Use
--host 0.0.0.0when starting the server - Check Raspberry Pi's IP:
hostname -I
- Update interval: 2 seconds (adjustable in
static/dashboard.js) - Lightweight API responses
- No database required
- Suitable for continuous monitoring
- Works well on Raspberry Pi 5
For production/classroom use:
- Network Access: Restrict network access via firewall
- HTTPS: Use a reverse proxy (nginx, Apache) with SSL/TLS
- Authentication: Add authentication layer if needed
- Read-Only: The dashboard only reads system metrics (no configuration changes)
Example nginx reverse proxy with SSL:
server {
listen 443 ssl http2;
server_name your-domain.com;
ssl_certificate /path/to/cert;
ssl_certificate_key /path/to/key;
location / {
proxy_pass http://localhost:5000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}Local-Host-Dashboard/
├── app/
│ ├── __init__.py # Flask app factory
│ ├── routes.py # API endpoints
│ └── system_monitor.py # System metrics collection
├── static/
│ ├── styles.css # Dashboard styling
│ └── dashboard.js # Frontend logic and updates
├── templates/
│ └── dashboard.html # Main HTML template
├── run.py # Application entry point
├── requirements.txt # Python dependencies
└── README.md # This file
To modify the dashboard:
- Frontend changes: Edit
templates/dashboard.html,static/styles.css,static/dashboard.js - Backend changes: Edit
app/system_monitor.pyorapp/routes.py - Add new metrics: Extend
SystemMonitorclass inapp/system_monitor.py
Open source - feel free to modify and distribute.
For issues or questions:
- Check this README
- Review browser console for JavaScript errors (F12)
- Check Flask logs for backend errors
- Verify all dependencies are installed
- Initial release
- CPU, Memory, Storage monitoring
- S.M.A.R.T data support
- Throttling detection
- Professional responsive UI
- Real-time updates
- Educational interface design