HTTP uptime check via bash + cron
Ensure your site returns 2xx every minute, alert to Slack/Telegram on failure.
Recipe
bash
#!/usr/bin/env bash
# /etc/cron.d/uptime-check
# * * * * * root /opt/uptime.sh https://example.com
URL="${1:?URL required}"
CODE=$(curl -o /dev/null -s -w "%{http_code}" -m 10 "$URL")
[ "$CODE" -ge 200 ] && [ "$CODE" -lt 400 ] || \
curl -X POST "$SLACK_WEBHOOK" --data "{\"text\":\"$URL → $CODE\"}"
Same thing in Enterno.io
Alternatively, Enterno tracks HTTP response + latency from 3 regions without Bash or webhooks — add the URL to monitors.
Related recipes
Minimal script that checks an SSL certificate and alerts 14 days before expiry.
Detect the moment a replica falls behind the primary by more than 10 seconds.
Your cron silently stopped running. Need an alert when the script misses its window.