Write a Server Health Check Script

Automate a report on disk, memory, load and services, and run it on a schedule.

+60

POINTS

What you will build

A small tool you could actually leave running on any server.

Starting point: you only need a Vultr account. This challenge is self-contained, so you can do it without having done any other.

The plan

  1. Deploy an Ubuntu 24.04 instance and connect over SSH
  2. Write a script that reports disk usage, memory, load average and uptime
  3. Check that at least two services (for example ssh and cron) are active
  4. Print a WARNING line when disk use is above 80 percent or a service is down
  5. Make the script exit non-zero when something is wrong
  6. Schedule it with cron and write the output to a log file
  7. Trigger a warning on purpose to prove it works
BASH
#!/usr/bin/env bash
set -euo pipefail
df -h /
free -m
uptime

How you will be judged

  • Readable output a tired person can understand at 3am
  • Thresholds are variables, not buried in the code
  • Passes ShellCheck with no errors

Destroy everything you created when you are done so you are not billed for it.

Requirements

Script reports disk, memory, load and uptime

Warns above a threshold and exits non-zero

Scheduled with cron and logging to a file

A warning triggered on purpose

Resources

Submit Your Build

Challenge Questions

No questions about this Challenge yet
Ask anything about this Challenge prep, agenda or joining.