PiWatchdog is a lightweight watchdog logger and web UI for Raspberry Pi, Rock Pi, and similar Debian or Ubuntu-based Linux boards.
It does two things:
- Logs recurring health snapshots with
systemd - Serves a small web UI so you can inspect recent history, charts, raw diagnostic blocks, speed tests, alerts, containers, and maintenance status
The project is intentionally self-contained:
- no Python packages to install
- no Node.js
- no database required
- no Docker dependency, but Docker is detected when available
Each watchdog snapshot records:
- uptime
- load average
- memory usage
- filesystem usage
- interface and route state
- Wi-Fi status
- socket summary
- Docker container status, if Docker exists
- temperature sensors
- gateway ping
- DNS resolution checks
- recent kernel warnings
When ping or DNS fails, it also records extra diagnostics such as:
resolvectl statusnmclistatuswlan0details- recent network-related journals
- interface counters
- gateway neighbor table
- summary cards
- mobile-friendly table
- newest-first or oldest-first sorting
- browser-local timezone rendering
- trend charts for:
- disk usage
- CPU load
- memory usage
- temperature
- ping latency
- clickable chart expansion with hover labels
- auto-load mode that redraws charts and appends new rows without reloading the page
- readable/raw snapshot inspector
- LAN speed test between the browser and the Pi
- network quality timeline for saved speed test results
- event timeline for notable watchdog findings
- in-page alerts for disk, temperature, DNS, ping, and containers
- container health panel when Docker is available
- maintenance panel for log rotation, cleanup status, reboot history, and storage breakdown
The UI can measure local network speed between the browser and the Pi:
Downloadmeasures Pi to browser throughputUploadmeasures browser to Pi throughput- available test sizes go up to
1 GB - each successful result is saved to a small JSONL history file
- history includes client label, client IP, Mbps, direction, quality badge, and latest watchdog ping avg/max
By default, speed history is stored under the web UI service user's home directory:
~/.local/share/pi-watchdog/speed-history.jsonl
Use the browser label field to distinguish devices or locations, such as MacBook, iPhone upstairs, or office desktop.
The current in-page alert checks are:
- disk over
80% - temperature over
70 C - DNS failed for
5consecutive watchdog snapshots - gateway ping failed for
5consecutive watchdog snapshots - Docker container not running, when Docker is available
Alerts are local to the web UI for now. Webhook or email delivery can be added later.
Tested on Debian and Ubuntu-style systems with:
systemdbashpython3iproute2pinggetent
Optional but supported:
NetworkManagerdockerresolvectljournalctliwnmcli
Copy the project to the Pi and run:
cd PiWatchdog
sudo ./setup.shDefault install behavior:
- installs app files into
/opt/pi-watchdog - writes logs to
/var/log/pi-watchdog.log - creates:
pi-watchdog-log.servicepi-watchdog-log.timerpi-watchdog-ui.service
- serves the UI on port
8098
Then open:
http://YOUR-PI-IP:8098/
You can override the defaults with environment variables:
sudo PI_WATCHDOG_USER=pi \
PI_WATCHDOG_PORT=8098 \
PI_WATCHDOG_INSTALL_DIR=/opt/pi-watchdog \
PI_WATCHDOG_LOG_PATH=/var/log/pi-watchdog.log \
PI_WATCHDOG_SPEED_HISTORY_PATH=/home/pi/.local/share/pi-watchdog/speed-history.jsonl \
./setup.shAvailable variables:
PI_WATCHDOG_USERPI_WATCHDOG_PORTPI_WATCHDOG_INSTALL_DIRPI_WATCHDOG_LOG_PATHPI_WATCHDOG_SPEED_HISTORY_PATH
If you update the project files later, run setup again:
sudo ./setup.shThat refreshes the installed scripts and restarts the services.
Check timer and services:
systemctl status pi-watchdog-log.timer
systemctl status pi-watchdog-ui.serviceWatch the log:
sudo tail -n 100 /var/log/pi-watchdog.logSee the last UI service logs:
sudo journalctl -u pi-watchdog-ui.service -n 100 --no-pagersudo systemctl disable --now pi-watchdog-log.timer pi-watchdog-ui.service
sudo rm -f /etc/systemd/system/pi-watchdog-log.service
sudo rm -f /etc/systemd/system/pi-watchdog-log.timer
sudo rm -f /etc/systemd/system/pi-watchdog-ui.service
sudo systemctl daemon-reload
sudo rm -rf /opt/pi-watchdog
sudo rm -f /var/log/pi-watchdog.log
rm -f ~/.local/share/pi-watchdog/speed-history.jsonl- The UI intentionally loads a recent window instead of the entire lifetime log so it stays fast on small boards.
- Kernel boot-time noise is visually separated from active warnings.
- The UI uses plain HTTP by default. If you want HTTPS and HTTP/2, put a reverse proxy like Caddy or nginx in front of it.
