๐ Website Status Monitor
๐ Checking all websites...
๐ Admin Credentials
Email testing requires admin authentication.
๐ง Send Test Email
Verify your email alert system is working. Enter a recipient address and click Send.
๐ง Quick Test All Groups
Send a test email to each group's alert recipient to verify all routing is working.
โน๏ธ About This Monitor
A real-time website monitoring dashboard that tracks the availability, response time, and uptime of multiple websites across different business groups. When a site goes down, email alerts are automatically sent to the designated group contact.
๐ ๏ธ Tech Stack
Cloudflare Pages
Hosts the static dashboard and serves it globally via Cloudflare's CDN edge network with near-instant load times.
Pages Functions
Serverless Workers at the edge. Each site is checked individually with 8-second timeout to stay within execution limits.
Cloudflare D1
SQLite serverless database. Stores 30 days of check history, alert logs, and monitored site configuration.
Gmail API
Sends alert emails via Google Workspace service account with JWT/OAuth2 โ no stored passwords needed.
Chart.js
Lightweight charting for uptime/downtime and latency graphs with interactive tooltips and period selection.
WAF Integration
Seamlessly monitors sites behind Cloudflare challenge pages using secure WAF skip rules.
โ๏ธ How It Works
- ๐ Health Check: Cron worker checks each site individually in parallel via
/api/check?url=X. Status code, latency, and errors are logged to D1. - ๐ Dashboard: The dashboard runs read-only batch checks for live display โ only cron writes to the database.
- ๐พ D1 Logging: Every cron result is stored in
status_log. Records older than 30 days are automatically purged. - ๐ Alert Routing: If a site is down and no alert was sent in the past hour, an email goes to the group's designated contact. Dedup is atomic to prevent duplicate alerts.
- ๐ง Daily Summary: At 9AM HKT, a summary email is sent to all recipients with the latest check results from DB.
- ๐ก๏ธ Admin Panel: Add, edit, or remove monitored sites through the admin panel (password protected).
- ๐ WAF Integration: Cloudflare zones are configured with WAF skip rules (including SBFM + managed rules) to allow monitoring traffic through challenge pages.
- ๐ Security: Cron endpoints require shared secret. Security headers on all responses. Chart.js loaded with SRI integrity check.
๐๏ธ Database Schema
- ๐
monitored_sitesโ URL, group, alert email, enabled flag (managed via Admin) - ๐
status_logโ Timestamp, URL, group, HTTP status, ok flag, latency, error - ๐ง
alerts_sentโ URL, alert type, timestamp, message
๐ฌ Alert Recipients
Each group has a designated alert email configured via the Admin Panel. Alert emails are rate-limited to 1 per URL per hour to prevent spam.