A simple website uptime monitor built with Python and GitHub Actions.
This repository periodically checks a list of URLs and stores their status in a JSON file.
It’s designed to be lightweight and easy to run completely from GitHub (no external server).
-
Automatic checks via GitHub Actions
A workflow in.github/workflows/runswatchdog.pyon a schedule. -
Multiple websites
The list of target URLs is stored instatus.json. -
Status tracking
For each website, the script updates: -
HTTP status (up / down)
-
Status code (e.g., 200, 404, 500)
-
Last check timestamp
-
Static JSON output
status.jsoncan be used by another frontend or dashboard.
watchdog_website/
├─ README.md
├─ status.json
└─ watchdog.py
status.jsoncontains the list of websites to monitor.- Each entry includes at least
url, and optionallyname,description, etc.
watchdog.pyreadsstatus.json.- For each URL:
- Sends an HTTP request.
- Determines UP/DOWN state.
- Updates status, code, and last-checked time.
- Runs
watchdog.pyon a schedule (cron). - Commits updated
status.jsonback into the repository automatically.
Your repo will always contain the latest status results.
git clone https://github.com/Hamedius/watchdog_website.git
cd watchdog_websitepython -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activatepip install -r requirements.txtIf you don’t have a requirements.txt, simply create one containing:
requests
Example format:
[
{
"name": "Example",
"url": "https://example.com",
"status": "",
"status_code": null,
"last_check": null
}
]python watchdog.pyAfter running, status.json will be updated.
The workflow in .github/workflows/:
- Uses a Python runner (e.g.,
ubuntu-latest) - Installs dependencies
- Runs
python watchdog.py - Commits the updated
status.jsonback to the repo
To change frequency, modify the cron expression:
on:
schedule:
- cron: "*/30 * * * *" # every 30 minutes- in secrets modify Emailto and Telegram CHat Id ex: 123@gmail.com,456@gmail.com
seperate by ","
- Add Telegram / Slack / email notifications
- Track history instead of only the latest check
- Create a frontend dashboard to visualize uptime
- Export metrics to monitoring services
Hamed Nahvi
GitHub: @Hamedius