VitaGuard: My First Real-Time Linux System Health Monitor in Bash

Published: (January 10, 2026 at 11:56 AM EST)
3 min read
Source: Dev.to

Source: Dev.to

Cover image for VitaGuard: My First Real-Time Linux System Health Monitor in Bash

What the script does

VitaGuard provides a continuously updating overview of system health:

Resource usage

  • CPU usage with visual progress bars
  • Memory usage (used vs total)
  • Disk usage for the root filesystem
  • Automatic warnings for high‑usage thresholds

System information

  • System uptime and load average
  • Active network interfaces

Processes

  • Top 5 processes by CPU usage
  • Clean, readable table output

Logs

Scans recent system logs for critical issues, filtering for errors such as:

  • Kernel issues
  • Failed services
  • OOM events

Reduces common log noise and limits output to the most recent entries.

Services

Checks the status of common services:

  • sshd
  • docker
  • nginx

All of this runs in an auto‑refreshing loop, updating every 5 seconds until you exit.

Why I built it

I wanted a lightweight tool that mirrors what I actually check when supporting or troubleshooting a Linux system—CPU, memory, disk, processes, and critical log entries—without any over‑engineering. The goals were:

  • Turn raw system metrics into a readable output
  • Build visual progress bars and color‑based alerts
  • Filter noisy logs to surface useful signals
  • Write Bash that is structured, readable, and safe
  • Create something practical that can be dropped onto a server and used immediately

Challenges & Fixes

  • Progress bar colors weren’t showing up initially. Fixed by using printf "%b" to make the escape codes work.
  • Syslog noise: added grep -v filters to remove junk like “workqueue” and “drm”.
  • Process table alignment: used awk with fixed widths to align everything nicely.

What I learned

  • Pulling system info (CPU, memory, disk) from commands like top, free, and df and cleaning it up with awk.
  • Using terminal color codes to make warnings stand out (green for good, red for bad).
  • Writing Bash scripts that don’t break easily by adding checks, handling empty results, and keeping the code readable.

What’s next

Planned improvements for VitaGuard:

  • Configurable refresh interval
  • Optional non‑interactive / one‑shot mode
  • Improved compatibility across Linux distributions
  • Optional HTML/JS dashboard for remote monitoring

Source code

The full script is available on GitHub:

GitHub logo

Repository:
VitaGuard is a lightweight Bash‑based system health monitor that provides real‑time insights into CPU, memory, disk usage, processes, logs, network interfaces, and service status on Linux systems.

🛡️ VitaGuard

Quickly monitor your Linux server’s vital signs straight from the terminal.

VitaGuard screenshot

🛠️ Technologies

  • Bash scripting
  • Core Linux tools: top, free, df, ps, grep, awk, tail

🚀 Features

  • Real‑time updates (refreshes every 5 seconds)
  • Color‑coded progress bars for CPU, memory, disk
  • Uptime and load average display
  • Top 5 processes by CPU usage (clean table)
  • Recent critical errors from syslog (filtered, max 3 lines)
  • ASCII art header

🔍 How it works

The script runs in an infinite loop that:

  1. Clears the terminal screen.
  2. Collects system metrics using standard Linux utilities.
  3. Renders color‑coded progress bars and warnings.
  4. Displays process, log, and service information.
  5. Sleeps for the configured interval (default 5 seconds) before repeating.
Back to Blog

Related posts

Read more »

Hello, Newbie Here.

Hi! I'm falling back into the realm of S.T.E.M. I enjoy learning about energy systems, science, technology, engineering, and math as well. One of the projects I...