Python uptime monitor for Raspberry Pi — checks websites, measures response times, sends Pushover push notifications on downtime, with a web dashboard showing status, uptime statistics, and response time graphs.
# Clone the repository
git clone https://github.com/Werizu/UptimeMonitor.git /tmp/uptime-monitor
cd /tmp/uptime-monitor
# Configure Pushover (see below)
cp config.example.json config.json
nano config.json
# Install
sudo ./install.sh- Create an account at pushover.net
- Create a new application at pushover.net/apps/build
- Add to
config.json:user_key: Your User Key (shown on the Pushover homepage)api_token: API Token of the created application
Edit /opt/uptime-monitor/config.json:
{
"sites": [
{
"name": "My Website",
"url": "https://example.com",
"check_interval": 300
},
{
"name": "API Server",
"url": "https://api.example.com/health",
"check_interval": 60
}
]
}check_interval: Check interval in seconds (default: 300 = 5 min)timeout: Seconds until timeout (default: 10)expected_status: Expected HTTP status code (default: 200)
After changes: sudo systemctl restart uptime-monitor
# Check status
sudo systemctl status uptime-monitor
sudo systemctl status uptime-dashboard
# Stop / Start
sudo systemctl stop uptime-monitor
sudo systemctl start uptime-monitor
# View logs
sudo journalctl -u uptime-monitor -f
sudo journalctl -u uptime-dashboard -fThe web dashboard runs on port 5000: http://<pi-ip>:5000
As a subdomain (uptime.example.com):
<VirtualHost *:80>
ServerName uptime.example.com
ProxyPass / http://localhost:5000/
ProxyPassReverse / http://localhost:5000/
</VirtualHost>Or as a subdirectory (example.com/uptime):
ProxyPass /uptime http://localhost:5000
ProxyPassReverse /uptime http://localhost:5000Enable Apache modules:
sudo a2enmod proxy proxy_http
sudo systemctl restart apache2SQLite database at /opt/uptime-monitor/data/uptime.db. Data older than 90 days is automatically cleaned up daily at 03:00.