All posts

Server Health Check: Metrics, Commands & Automation

August 25, 2026

What Is a Server Health Check?

A server health check evaluates the operating system and infrastructure layer of a machine — CPU load, memory, disk space, network throughput, and process/service status. It answers one question: is the box itself capable of doing work right now? That's narrower than "is my application working," which is what health check tests, uptime pings, and container probes answer.

A server can pass every infrastructure check — plenty of free RAM, low CPU load, healthy disk — while the application on it is deadlocked, throwing 500s, or stuck waiting on a database connection. A struggling application can likewise mask a server that's actually fine. If you need the application-level picture, our healthcheck test guide covers HTTP/endpoint checks. This article stays at the OS layer: the metrics, the exact commands to pull them, and how to stop running that process by hand.

The Core Metrics Every Server Health Check Should Cover

Not every number top throws at you matters equally. These five categories cover the signal; everything else is mostly noise for a quick health assessment.

  • CPU load average — the 1/5/15-minute averages should generally stay below your core count. On a 4-core server, a sustained load average above 4 means work is queuing; above 8 is a clear warning.
  • Memory usage (RAM) — under roughly 80% used is healthy; consistently above 90%, especially with heavy swap use, signals trouble.
  • Disk space utilization — keep usage under 80% on any mounted volume. Past 90%, expect failures in logging, temp files, and package installs.
  • Network I/O — watch for unexpected spikes in traffic, dropped packets, or retransmits, which often precede latency complaints.
  • Uptime and process/service status — confirm the server hasn't unexpectedly rebooted and that critical services (databases, web servers, cron daemons) are actually running, not just installed.

Together these make up the core set of server monitoring metrics worth tracking on any machine, whether it's a single VPS or one node in a larger fleet. CPU, memory, and disk monitoring alone will catch the majority of real-world incidents before they become outages.

Linux Commands to Check Server Health

Each metric above maps to a handful of standard Linux tools — run manually first, then wrap into a script.

CPU load:

uptime
top
htop

uptime gives the 1/5/15-minute load averages instantly. top and htop show which processes are driving that load in real time.

Memory:

free -m
vmstat 1 5

free -m shows total, used, free, and cached memory in megabytes — check the available column, not just free. vmstat adds context on swapping activity over a few samples.

Disk space:

df -h
du -sh /var/log/*

df -h gives per-partition usage in human-readable form. If a volume is close to full, du -sh helps you find what's eating the space.

Network:

ss -tuln
netstat -i

ss -tuln lists listening ports and active connections (the modern replacement for netstat). netstat -i shows interface-level packet and error counts.

Uptime and services:

uptime
systemctl status
systemctl status 

systemctl status gives an overview of failed units at a glance; checking a specific service confirms it's active and hasn't crash-looped.

Run these in sequence and you have a complete linux server health check in under a minute. The next step is not remembering to run them — it's not having to.

Manual Checks vs. Automated Health Check Scripts

Running these commands by hand works fine the first time something feels off. It fails as an ongoing practice. Nobody reliably logs into a server every few hours to eyeball df -h, and the incidents that matter most — disk filling up overnight, memory creeping toward exhaustion over a weekend — happen precisely when no one's watching.

The fix is a server health check script: a shell script that runs each command, captures the output, compares values against thresholds, and flags anything past warning levels. A basic version might grep the load average out of uptime, parse free -m for percentage used, and check df -h for any partition over 80%, writing results to a log or sending an alert if something crosses the line.

This is where automated server health check practice actually starts paying off — you shift from "did anyone notice" to "the system told us." But a script sitting on a server does nothing unless something makes it run on a schedule, which is where cron comes in.

Automating Server Health Checks with Cron (and the Blind Spot It Creates)

A typical pattern looks like this in your crontab:

*/15 * * * * /opt/scripts/health_check.sh >> /var/log/health_check.log 2>&1

Every 15 minutes, the script runs, checks CPU, memory, disk, and services, and logs or alerts on anything abnormal. For an hourly schedule instead, our cron hourly guide covers syntax and common pitfalls.

Here's the blind spot almost nobody accounts for: cron doesn't tell you when a job fails to run at all. If the script has a bug, the server reboots and the cron daemon doesn't restart cleanly, a permissions change breaks execution, or the disk you're checking is so full that the script itself can't write its log — you get silence, not an alert. Your dashboard looks fine because nothing has updated it in six hours, and "no news" gets mistaken for "good news."

This is exactly the gap a cron job monitoring for the health check script itself closes. You're no longer just checking server health — you're monitoring whether the thing that monitors server health is still alive. For a broader breakdown of which check type catches this kind of failure, see monitoring check types explained.

Choosing the Right Tool for Ongoing Server Monitoring

Full infrastructure monitoring platforms like Nagios are built for large, complex environments — dashboards, historical graphing, multi-server alerting, and deep integrations. They're powerful but heavy to configure and maintain if all you need is confidence that your existing health check script actually ran.

For teams that already have a working script scheduled via cron, a lightweight cron-monitoring layer is often the better fit than standing up a full platform. Cronevra sits at exactly that layer: it doesn't replace your health check script or reinvent server monitoring metrics — it watches the execution of the job that runs them, alerting you the moment a scheduled run doesn't check in, errors out, or goes silent. If you're piecing together the full picture across app, database, and infrastructure layers, the full-stack health checks guide is a useful next read.

Monitor the Monitor

Once your server health check runs as a scheduled script, that script becomes a single point of failure. If the cron job stops firing, you don't get an error — you get silence, and silence is easy to miss until something's already broken. Cronevra tracks the execution of your health-check scripts and alerts you the moment a run is missed or fails, so your monitoring doesn't have its own blind spot. Check the pricing page to see which plan fits your setup.

Frequently Asked Questions

What is the difference between a server health check and an application health check?

A server health check inspects OS-level resources — CPU, memory, disk, network, and running services — to confirm the machine itself has capacity to operate. An application health check tests whether the software running on that server is actually functioning correctly, often via an HTTP endpoint or internal status route. A server can be healthy while the application on it is broken, and vice versa.

How often should I run a server health check?

For most production servers, every 5 to 15 minutes via a scheduled script is a reasonable baseline, tightening to every 1-5 minutes for critical systems. Manual checks are fine for troubleshooting but shouldn't be your only safeguard, since problems like disk exhaustion often happen outside working hours.

What is a good CPU or memory usage threshold for a healthy server?

Keep CPU load average below your server's core count and memory usage under roughly 80% as a healthy baseline. Sustained load above double your core count, or memory consistently above 90% with active swapping, are clear warning signs worth investigating immediately.

Can I automate server health checks with a cron job?

Yes — a shell script combining commands like uptime, free -m, and df -h can run on a cron schedule and alert on threshold breaches automatically. The catch is that cron itself can fail silently if the job errors out or stops running, so the check needs its own monitoring to be reliable.

What Linux command shows overall server health at a glance?

uptime gives the fastest single-line snapshot, showing load averages and how long the server has been running. For a fuller picture, pair it with free -m for memory, df -h for disk, and systemctl status for service state.

Do I need a monitoring tool if I already have a health check script?

You need something watching the script's execution, even if the script itself is solid. A full platform like Nagios makes sense for large, complex environments, while a lightweight tool like Cronevra is a better fit for teams that just need confirmation their scheduled health check script ran successfully and an alert when it doesn't.