Skip to content
AkOps Labs
All build projects
Beginner· ~45 minFree

Server health report in Bash

A script ops teams really use: host, disks, memory and the busiest processes, checked by ShellCheck.

You'll end with: A tested Bash script in your GitHub, with a green pipeline badge.

Do it here, in your browser

Follow the steps on the left and type in the terminal on the right. Each step ticks itself off when your files are right. At the end, one button creates the repository in your GitHub with your work, and you get a ready LinkedIn post.

Or do it on your own computer

Prefer a real terminal? Make your copy from our GitHub template, work in Codespaces or on your machine, then submit the link below.

Use the GitHub templateCreates your own copy of akopslabs/build-linux-health

Steps on your own computer

  1. 1

    Make your copy

    Press Start this project. GitHub asks for a repository name: keep it, make it Public, and press Create repository.

  2. 2

    Open a terminal

    In your new repository press Code → Codespaces → Create codespace. You get VS Code and a Linux terminal in the browser, free. Or clone it on your own Linux or Mac machine.

  3. 3

    Write the script

    Open report.sh and replace every TODO. Print four sections in this order: == Host ==, == Disk ==, == Memory ==, == Top processes ==.

    hostname; uname -r; uptime -p
    df -h
    free -h
    ps -eo pid,comm,%cpu --sort=-%cpu | head -6
  4. 4

    Test it like the pipeline does

    Run the same check GitHub runs. Fix anything that says FAIL.

    chmod +x report.sh
    ./report.sh
    bash tests/check.sh
  5. 5

    Push

    Commit and push. Open the Actions tab and wait for AkOps check to turn green.

    git add report.sh
    git commit -m "Server health report"
    git push
  6. 6

    Submit and share

    Paste your repository link below and press Check my project. When it passes you get your badge and a ready-made LinkedIn post.

Submit your project