How to Set Up Uptime Monitoring From Outside Your Hosting Account

How to Set Up Uptime Monitoring From Outside Your Hosting Account

External uptime monitoring setup means running checks from a machine that is not inside your hosting provider's network, so a failure at the host cannot also silence the alarm. The core idea is simple: a separate checker sends a request over the public internet, measures whether a valid response comes back, and alerts you when it does not. Everything else is detail about which protocol you check, what counts as success, and how you avoid false alarms.

Why checks that run inside the host prove very little

If your monitor lives on the same server or in the same network as the site, it shares fate with the thing it watches. When the host's upstream link drops, the power fails, or the hypervisor stalls, the monitor goes down with the site and reports nothing. You learn about the outage when a customer tells you. A checker on a different network, ideally in a different region, keeps running and keeps reporting.

The second reason is ICMP. Many providers filter ping at the edge, and plenty of firewalls drop it by default. A monitor that only pings will show your site as down while it is serving traffic perfectly well, and after a few of those alerts you stop trusting the monitor. That is worse than having none. Check at the application layer instead, using HTTP or HTTPS, and treat ICMP as an optional extra rather than the primary signal.

What to check and what a good response looks like

For a website, the useful check is an HTTPS request to a URL that exercises the stack you care about: DNS resolution, TCP connect, TLS handshake, the web server, and the application. A request to the home page is fine, but a dedicated health endpoint is better because it can confirm the database connection and cache are alive without rendering a full page.

Success is not just "the connection opened". Decide on a status code rule, usually any 2xx or 3xx response, and check the body for a known string so a generic error page served with status 200 does not pass. You can do this by hand from any machine outside the host, which is the fastest way to confirm what a monitor should expect.

curl -sS -o /dev/null -w '%{http_code} %{time_total}s %{time_connect}s\n' \
  https://example.com/health
# 200 0.184s 0.031s

The -w format string is the useful part. %{http_code} gives you the status, %{time_connect} isolates TCP connect time from total time, and %{time_total} covers the whole exchange. If connect time is high but total time is not much higher, the problem is network path or host reachability rather than your application. If connect is fast and total is slow, the application is the suspect.

Checking the certificate and the redirect chain

TLS expiry is a classic self-inflicted outage, so have the monitor check it. A quick manual check reveals the expiry date and whether the chain validates:

echo | openssl s_client -connect example.com:443 -servername example.com 2>/dev/null \
  | openssl x509 -noout -subject -dates
# subject=CN = example.com
# notBefore=...  notAfter=...

Also decide whether the monitor should follow redirects. If http:// redirects to https://, check the final URL directly and add a separate check on the redirect only if that hop matters to you. Following redirects silently can mask a broken hop.

Running your own checker: external uptime monitoring setup with a script and a timer

You do not need a commercial service to get an independent check. A small instance at another provider, or a machine in a different datacenter, can run a script on a timer and alert you. Keep the script boring and make it write one line per run so you can read the history later.

#!/bin/sh
url="https://example.com/health"
code=$(curl -sS -m 10 -o /tmp/body -w '%{http_code}' "$url") || code=000
if [ "$code" -ge 200 ] && [ "$code" -lt 400 ] && grep -q '"status":"ok"' /tmp/body; then
  echo "$(date -u +%FT%TZ) ok $code"
else
  echo "$(date -u +%FT%TZ) FAIL $code" >&2
  # send alert here: mail, webhook, or a push to your phone
fi

Run it from cron every minute, or use a systemd timer if you prefer. Two details matter. First, set a hard timeout with -m so a hung connection does not leave the check waiting forever. Second, alert only after a few consecutive failures, not on the first one, or a single dropped packet will wake you at night. Keep the raw log and alert on the transition, not on every failing run.

If you use a hosted monitoring service instead, the mechanics are the same, just configured in their interface: the URL, the method, the expected status, a body match, the check interval, and the regions the check runs from. Choose at least two regions so a routing problem between one network and your host does not look like a full outage.

Reading the alert without panicking

When an alert fires, confirm it from a third location before you page anyone. A quick check from your own machine tells you whether the problem is global or specific to the monitor's network path.

curl -sS -I --max-time 10 https://example.com/health
dig +short example.com
# 203.0.113.10

Compare what you see with what the monitor reported. If your request succeeds and the monitor's failed, the difference is usually DNS, a firewall rule that allows your address but not the monitor's, or a regional routing issue. If both fail, treat it as real. Check DNS separately because a resolver problem looks identical to a dead server from the monitor's point of view, and dig against a public resolver will show whether the record resolves at all.

What to do next

Pick one health URL that proves the application works, not just that a socket accepts connections. Add a check from a network you do not control, set a sensible timeout and a failure threshold of two or three consecutive runs, and make sure the alert reaches a channel you actually read. Then test it deliberately: block the monitor's address at the firewall or stop the service for a minute and confirm the alert fires and clears. A monitor you have never seen fail is a monitor you cannot trust.

Related articles

Subscribe to our newsletter

Get the latest hosting tips, performance insights, and industry news.