How to Monitor a Server: Uptime, Resources and Alerts

The three layers of server monitoring — external uptime checks, resource metrics with alerts, log-based detection — free tools for each, and thresholds to set.

Published
Reading time
3 min

Monitoring is how you find out about a problem before a customer does. Done properly it is three separate things: a check from outside that the site is reachable, metrics from inside that show the server's health, and alerts that reach a person. Most setups have one of the three. Here is all three with free tools.

Layer 1: is the site up? (external)

A service somewhere else on the internet loads your site every minute and alerts you when it cannot, or when it returns the wrong status, or when the response does not contain a string you expect. This is the check that matters most, because it measures what visitors experience.

Free options: UptimeRobot (50 monitors, 5-minute interval), Better Stack, Hetrix Tools, StatusCake. Set up:

  • An HTTPS check on the homepage, looking for a keyword that only appears when the page rendered properly (a footer line, not "WordPress").
  • A check on a dynamic page (a product page, the login page) so a cached homepage does not hide a dead PHP.
  • An SSL expiry check — most services include it.
  • Alerts by email and something that makes a noise: SMS, Telegram, Slack, a phone app.

Two-minute intervals with confirmation from a second location avoids false alarms from a single flaky probe.

Layer 2: what is happening inside (metrics)

Load, CPU, memory, disk space, disk I/O, network, and per-service numbers — PHP-FPM workers, MySQL connections, Nginx requests. Collected every few seconds, graphed, with thresholds.

Netdata is the fastest to set up: one command installs an agent that auto-discovers Nginx, PHP-FPM, MySQL, Redis and the rest, with a live dashboard on port 19999 (restrict it to your IP or put it behind auth) and built-in alarms with sensible defaults.

bash
wget -O /tmp/netdata-kickstart.sh https://get.netdata.cloud/kickstart.sh && sh /tmp/netdata-kickstart.sh

Connect it to Netdata Cloud (free tier) and alerts arrive by email or app without opening any ports.

Prometheus + Grafana is the industry standard for fleets — more to set up, unlimited flexibility. Zabbix and LibreNMS are the classic all-in-ones. For one to five servers, Netdata is enough.

Thresholds worth alerting on:

Metric Warn Critical
Disk space 80% 90%
Memory available < 15% < 5%, or swap in use rising
Load (per core) > 1.5 for 10 min > 3 for 10 min
I/O wait > 10% for 10 min > 30%
PHP-FPM active ≥ 80% of max_children max reached
MySQL connections > 80% of max max reached
SSL expiry 14 days 7 days

What the load and CPU numbers mean is in understanding load average, top and htop.

Layer 3: things that are wrong but not down (logs)

A site that is up but returning 500 to one in ten requests; a backup job that has silently failed for a month; a login attack that is succeeding. These show in logs, not metrics.

  • Error rate: count 5xx responses in the access log per minute and alert if it rises. Netdata's web log collector does this; so does GoAccess with a cron.
  • Cron jobs: each important job pings a dead-man's-switch (Healthchecks.io, Cronitor) on success; the service alerts when a ping is late. Setup in knowing when cron jobs fail.
  • Security events: Fail2ban's ban log, auth.log successful logins from new addresses, Plesk's action log. A daily summary email is enough for most; logwatch produces one.

Alerting that works

  • Route by severity. Disk at 80% is an email for tomorrow; site down is a phone alert now.
  • Avoid alert fatigue. Every alert should require action. If one fires weekly and nobody acts, raise the threshold or fix the cause.
  • Escalate. If nobody acknowledges in 15 minutes, notify the next person. Better Stack and Opsgenie do this; for one person, a second channel (SMS after email) is the escalation.
  • Test it. Stop Nginx for two minutes and confirm the alert arrives, on the channel you expect, at the person on duty.

A status page

For customers, a public page showing current status and incident history turns "is it just me?" into a link. Better Stack and UptimeRobot both generate one from the checks above. Ours is at /status.

What managed means here

On a VPSPioneer managed VPS, all three layers are running before handover: external checks every five minutes, resource metrics with the thresholds above, and log-based detection — with alerts going to an engineer on duty, not to you. You get the ticket that says what happened and what we did about it.

#servers#monitoring#uptime#alerts#netdata

Keep reading

More from Servers

All guides

Servers

How to Back Up a Server With rsync and restic

Two command-line backup approaches — rsync for plain mirrors, restic for encrypted, deduplicated snapshots to S3 or another server — with a nightly script.

4 min read →

Servers

Cloudways Alternative: Managed Hosting Without the Markup

What Cloudways does, what its management layer is worth, and when shared hosting, a managed VPS or a self-managed VPS fits your sites better.

8 min read →

Servers

Hetzner and DigitalOcean Alternatives for UK & EU Projects

A fair framework for choosing a Hetzner alternative or DigitalOcean alternative in the UK and EU: location, billing, support, backups and how to test.

8 min read →