An open API service indexing awesome lists of open source software.

https://github.com/hpats/pimonitorsystem


https://github.com/hpats/pimonitorsystem

pi python raspberry-pi raspberry-pi-4

Last synced: 5 months ago
JSON representation

Awesome Lists containing this project

README

          

# Raspberry Pi System Monitoring Dashboard

A Flask-based web dashboard for monitoring system performance, WireGuard stats, network metrics, and external sensor/weather data on a Raspberry Pi.

[![example image 1](example_images/example_main_1.png)](#)

# Raspberry Pi System Monitoring Dashboard

A Flask-based web dashboard for monitoring system performance, WireGuard stats, network metrics, and external sensor/weather data on a Raspberry Pi.

---

## βš™οΈ Features

### πŸ–₯️ System Monitoring
- CPU Temperature
- CPU Usage %
- RAM Usage (used/total)
- Disk Space (used/total and %)
- Load Average (1, 5, 15 min)
- System Uptime
- Hostname and IP addresses

### πŸ” WireGuard Statistics
- Transmitted (TX) Packets
- Received (RX) Packets
- TX/RX Deltas

### 🌐 Network Diagnostics
- Local and Public IP
- Online Status (via 1.1.1.1)
- Gateway and DNS Servers
- Ping Latency
- Packet Loss %

### 🌦️ Sensor and Weather Integration
- Sensor support (local HTTP endpoint)
- NOAA Weather API integration
- Logs:
- Temperature, Humidity, Pressure, Gas
- PM10, PM2.5, PM100

### πŸ“ Data Logging
- Logs data to CSV with rolling log (2560 lines)
- Three separate CSVs: system, WireGuard, sensor/weather

### πŸ“‘ JSON API Endpoints
- `/json_data`: System metrics (CPU, RAM, Disk)
- `/json_dataWG`: WireGuard TX/RX and deltas
- `/json_data_weather`: External sensor/weather data
- `/json_system_info`: Realtime snapshot with network diagnostics

---

## πŸ› οΈ Requirements

- Python 3.x
- Flask
- Raspberry Pi OS or compatible Linux
- PiVPN (WireGuard)

---

## πŸš€ Installation

1. **Clone the repository:**

```bash
git clone https://github.com/your-username/system-monitoring-app.git
cd system-monitoring-app
```

2. **Install required dependencies:**

```bash
pip install flask requests
```

3. **Run the application:**

```bash
python piMonitorWebServer.py
```

---

## 🌐 Usage

Open your browser and navigate to:

```
http://localhost:5005
```

You can also access it from any device on the same network using your Pi’s IP address.

---

## πŸ“‘ Endpoints

| Route | Description |
|------------------------|-------------------------------------------------------|
| `/` | Main dashboard (includes PiVPN status) |
| `/json_data` | Returns recent system performance metrics (CSV→JSON) |
| `/json_dataWG` | Returns WireGuard TX/RX + deltas |
| `/json_data_weather` | Returns external sensor + weather data |
| `/json_system_info` | Returns live system and network info (no history) |

---

## πŸ”§ Customization

You can tweak the following:
- CSV log length: change `MAX_LINES`
- Monitoring interval: edit `time.sleep(300)` in `update_*` threads
- Sensor/weather source URLs in `get_sensor_data()` and `get_weatherGOV_data()`
- Add more endpoints via Flask if needed

---

## 🀝 Contributing

Pull requests are welcome! For major changes, please open an issue first to discuss what you'd like to change or add.

---

## πŸ“„ License

MIT License β€” see the `LICENSE` file for full details.