← All posts
Guides· 6 min read

How to Monitor Server Uptime From Outside Your Network

Set up external uptime monitoring for Linux servers with real commands, check types, and alert configs — so you know about outages before your users do.

By , Director of Softuvo Solutions (LinkedIn) · Published · Updated

Your internal monitoring says everything is fine. Meanwhile, your users are hitting a blank screen. This is one of the most frustrating situations in production ops — and it happens because monitoring from inside your own network can't tell you what the outside world actually sees. A crashed nginx process, a misconfigured firewall rule, or a full TCP connection queue can take your site down completely while your internal health checks keep reporting green. External uptime monitoring — a check that runs from outside your infrastructure — is how you close that gap.

Why internal monitoring isn't enough

Internal checks — whether from a cron job, a local Prometheus exporter, or an agent on the same host — share the same failure domain as your application. If your server's network interface goes down, your host-based monitor goes dark too. If a BGP route drops your server off the internet, everything inside the network looks normal. You need at least one monitoring vantage point that lives outside your infrastructure entirely, making real HTTP or TCP requests the same way a user would.

This is the core distinction between server monitoring and uptime monitoring. Server monitoring tools — agents running on the host — measure CPU, memory, disk, running processes, and log output. Uptime monitoring probes your service from the outside and confirms reachability. Linux monitoring tools like Prometheus node_exporter or Netdata give you deep host metrics. None of them can tell you that your server is unreachable from Frankfurt if your data center is in Singapore. You need both perspectives.

The simplest starting point: cron plus curl

If you are not ready to add a third-party service, you can get basic external visibility with a second VPS in a different data center running a cron job. It is not fancy, but it works.

  • Spin up a small instance at a different provider — a $4/month VPS in a different region is enough.
  • Install curl and msmtp (or any mail sender) on it.
  • Add a cron entry like: */5 * * * * curl -sf --max-time 10 https://yourapp.com || echo 'Down at '$(date) | mail -s 'ALERT: yourapp.com down' you@example.com
  • Use curl's -sf flags: -s suppresses progress output, -f makes curl return a non-zero exit code on HTTP 4xx/5xx responses.
  • Add --max-time 10 so a hung connection doesn't silently time out and miss the alert.

To also capture response time, replace the bare curl with this and log it:

#!/bin/bash
URL="https://yourapp.com"
RESULT=$(curl -sf --max-time 10 -w "%{http_code} %{time_total}" -o /dev/null "$URL" 2>&1)
HTTP_CODE=$(echo $RESULT | awk '{print $1}')
TIME=$(echo $RESULT | awk '{print $2}')
echo "$(date -Iseconds) $URL status=$HTTP_CODE time=${TIME}s" >> /var/log/uptime-check.log
if [ "$HTTP_CODE" != "200" ]; then
  echo "$URL returned $HTTP_CODE at $(date)" | mail -s 'ALERT: uptime check failed' you@example.com
fi

This gives you a timestamped log you can grep later. Expected log output looks like: `2025-06-01T14:32:01+00:00 https://yourapp.com status=200 time=0.312s`. If the file starts showing non-200 codes or empty status fields, your service has a problem the outside world can see.

This approach has real limits — no dashboards, no history, no alert deduplication — but it catches total outages and costs almost nothing. Treat it as a floor, not a ceiling.

Purpose-built external monitoring services

For anything running production traffic, you want a dedicated uptime monitoring service. These run checks from multiple geographic locations, track response time history, calculate uptime percentages, and send alerts through Slack, PagerDuty, email, or SMS. Several good options exist across different price points.

  • Uptime Robot — free tier includes 50 monitors at 5-minute intervals; paid plans get 1-minute checks and SMS alerts.
  • Better Uptime — clean UI, incident timelines, on-call scheduling; free tier available.
  • Freshping — checks from 10 global locations on the free plan, useful for teams that need geographic spread.
  • Checkly — more developer-focused, lets you write Playwright or Puppeteer scripts to monitor real user flows, not just HTTP status codes.
  • StatusCake — solid free tier with page speed monitoring included.
  • PA Server Monitor — a Windows-centric server monitoring tool often compared in this space; it monitors Windows event logs and services natively but does not run a Linux agent, so it is not a fit for Linux-only fleets.

When configuring any of these, don't just monitor your homepage. Add checks for your API health endpoint (something like /healthz or /api/status), your login flow if you have one, and any critical third-party integrations. A 200 OK on your marketing page doesn't mean your checkout is working.

What to actually monitor and how to configure it

The check type matters. Here are the main ones and when to use each:

  • HTTP/HTTPS checks — verify that a URL returns an expected status code. Enable the body keyword match to confirm your app actually rendered content, not just that nginx returned a 200 with an error page behind it.
  • TCP checks — confirm a port is accepting connections. Use this for databases, SMTP, or any non-HTTP service that is exposed externally. A TCP check to port 5432 tells you PostgreSQL is reachable; it does not tell you queries are working.
  • Ping (ICMP) checks — the most basic signal: is the host responding at all? Useful as a baseline, but some networks block ICMP so a ping failure alone is not conclusive.
  • DNS checks — verify that your domain resolves to the expected IP. Catches misconfigured DNS records, expired domains, or hijacked DNS entries before users notice.
  • SSL certificate expiry — most services check this automatically on HTTPS monitors. Set a threshold of at least 14 days so you have time to renew before expiry causes browser warnings. Let's Encrypt certificates are valid for 90 days; check that your auto-renewal cron or systemd timer is actually firing.
  • Cron heartbeat (dead man's switch) — your cron job pings a URL on success; if the ping doesn't arrive within the expected window, you get alerted. This is the only way to know a cron job silently stopped running.

For SQL Server monitoring specifically: external TCP checks to port 1433 (or your custom SQL Server port) confirm the instance is accepting connections, but they don't validate query execution. Pair the TCP check with a lightweight script on an external host that opens a real connection and runs `SELECT 1`. If you are running MySQL or PostgreSQL on Linux, the same logic applies — use a TCP probe for network reachability and a query probe for actual database health.

# Quick external MySQL reachability check from a second host
# Replace the values with your actual host, port, user and password
mysql -h yourdb.example.com -P 3306 -u monitor_user -pmonitor_pass \
  -e "SELECT 1" --connect-timeout=5 2>&1
# Expected output if healthy:
# +---+
# | 1 |
# +---+
# | 1 |
# +---+
# Exit code 0 = reachable and query succeeded
# Exit code 1 = connection refused, auth failed, or query error
  • Set your check interval to 1 minute for anything customer-facing. 5 minutes is too slow for a production incident.
  • Configure alerts to fire after 2 or 3 consecutive failures to avoid false positives from transient network blips.
  • Set up a status page — even a private one — so your team has a single source of truth during an incident.
  • Monitor from at least two geographic regions to distinguish a regional network issue from a full outage.
  • Store your monitor configuration in version control using the service's API or a Terraform provider if it offers one.

What to look at on the Linux server when an external check fails

An external monitor tells you that something is down — it can't tell you why. When the alert fires, work through these checks in order. Each one takes under a minute and narrows the problem space.

# 1. Is the service process actually running?
systemctl status nginx
# Look for: Active: active (running) -- if it says failed, that's your answer

# 2. What did the service log in the last 5 minutes?
sudo journalctl -u nginx --since '5 minutes ago' --no-pager
# Common culprits: 'worker_connections are not enough', 'address already in use'

# 3. Is the port actually listening?
ss -tlnp | grep ':80\|:443'
# Expected output if nginx is up:
# LISTEN 0 511 0.0.0.0:80  0.0.0.0:* users:(("nginx",pid=1234,fd=6))
# No output = nothing is listening on that port

# 4. Check TCP connection state counts
ss -s
# If TIME-WAIT or CLOSE-WAIT counts are in the thousands, you may have a connection exhaustion problem

# 5. Is the disk full?
df -h
# A full disk (/dev/sda1 at 100%) can cause nginx to fail to write logs and then refuse connections

# 6. Is the system under memory pressure?
free -h
# Check 'available' column -- if it's near zero, the OOM killer may have taken out a process

# 7. Check for recent OOM kills
sudo dmesg | grep -i 'oom\|killed process' | tail -20

# 8. CPU and load
vmstat 1 5
# Five lines of output; watch 'r' (run queue) and 'wa' (IO wait)
# r > number of CPU cores = CPU bound; wa > 20 = IO bound

If you are running Docker containers, also check:

# Are containers running?
docker ps --filter 'status=exited'
# Any container listed here has stopped

# What did it log before dying?
docker logs --tail 50 <container_name>

# Resource pressure across containers
docker stats --no-stream

For Linux server monitoring at the kernel level, two more commands fill in gaps the above misses:

# Open file descriptor count -- hitting the system limit causes 'too many open files' errors
cat /proc/sys/fs/file-nr
# Output: <open_fds>  <unused_fds>  <system_max>
# If open_fds is close to system_max, raise fs.file-max in /etc/sysctl.conf

# Network interface errors -- packet drops or errors indicate hardware or driver problems
ip -s link show eth0
# Look for non-zero RX errors or TX dropped counts
External monitoring tells you when you are down. Server-side context tells you why. You need both, and you need them fast enough to act before users notice.

Alert routing and on-call setup

Getting the alert is only useful if the right person sees it at the right time. A few practices that reduce noise without missing real incidents:

  • Route critical alerts (service down, SSL expiry under 7 days, disk over 95%) to PagerDuty or OpsGenie with on-call rotation. Route warnings (disk over 80%, response time over 2s) to Slack only.
  • Define an escalation path: if the primary on-call doesn't acknowledge within 10 minutes, page the secondary. Most incident management tools support this natively.
  • Use alert deduplication: if your check fires every minute and your service is down for 20 minutes, you want one incident, not 20 separate pages.
  • After every significant incident, write a post-mortem. Even a short one. The pattern of 'what failed, why our monitors didn't catch it sooner, and what we changed' is how monitoring setups improve over time.
  • Test your alerts deliberately. Take a non-production server offline for 2 minutes and confirm the page fires. Alert configurations that have never been tested in anger often have silent gaps.

Choosing a Linux server monitoring tool that does both

Most linux monitoring tools sit in one of two camps: host-based agents (Prometheus node_exporter, Netdata, Zabbix agent, Datadog agent) that give you deep system metrics, or external uptime services (Uptime Robot, Better Uptime, Freshping) that probe from outside. Running both is the right architecture, but it creates two separate alert streams, two dashboards, and no automatic correlation between an external failure and its server-side cause.

Server monitoring software that combines an on-host agent with external probes in a single workflow is worth evaluating if you are managing more than a handful of Linux servers. The agent collects host metrics and log data; the external probes confirm outside reachability; and when a probe fails, the tool can surface the server-side context immediately rather than making you SSH in under pressure.

When evaluating any server monitoring tool for Linux, check these specifics: whether the agent opens inbound ports (a security risk on hardened servers), how it handles secrets and log data, what auto-discovered services it covers (systemd, Docker, PM2, Supervisor, nginx vhosts, SSL expiry), and whether it can send alerts to your existing channels rather than requiring a new workflow.

Opservo is built around this combined model. The agent is a single static Go binary under 10 MB, read-only by default, with no inbound ports — all traffic is outbound HTTPS. It auto-discovers systemd services, Docker containers, PM2 apps, Supervisor programs, nginx and Apache vhosts, SSL certificates, Redis, MySQL, and PostgreSQL. When an external uptime check fires — HTTP, TCP, ping, DNS, or heartbeat — the agent on the server surfaces the correlated log patterns and resource metrics in plain English so you understand what happened without running five commands manually. The free plan covers two servers with no card required.

Start with the simplest external check you can set up today — even the cron-and-curl approach above — and layer on more sophistication as your infrastructure grows. The worst time to discover your monitoring had a blind spot is during an incident at 2 AM.

Read next in the server health and monitoring series: How do you monitor a Linux server without an SRE? and How do you monitor multiple Linux servers from one place?. The whole series is at Server health and monitoring.