Linux-health
A lightweight, fast, and dependency-free Linux system health monitoring tool written in Go.
The tool provides a clean, boxed CLI view of essential system metrics for quick diagnostics.
Overview
linux-health is designed to give a concise yet meaningful snapshot of a Linux system's current health.
It avoids heavy dependencies, background daemons, or graphical interfaces, making it suitable for servers, virtual machines, and SSH environments.
Features
System Metrics
- CPU usage
- Memory usage
- Disk usage
- Load average
- System uptime
Process Analysis
- Detects the top memory-consuming process
- Displays process name, PID, and memory usage
Disk Analysis
- Identifies the largest directories (disk hotspots) inside the user home directory
Service Health
- Detects failed or inactive systemd services
- Displays a healthy message when no issues are found
Network Status
- Determines whether any non-loopback network interface is active
Output
- Clean, boxed terminal output
- Designed for readability and consistency across terminals
Project Structure
linux-health/
βββ cmd/
β βββ linux-health/
β βββ main.go
β
βββ internal/
β βββ system/
β βββ process/
β βββ disk/
β βββ service/
β βββ network/
β
βββ pkg/
β βββ output/
β βββ block.go
β
βββ go.mod
βββ README.md
Requirements
- Linux operating system
- Go 1.20 or newer
- systemd (for service health checks)
Installation
Clone the repository:
git clone https://github.com/ravindran-dev/linux-health.git
cd linux-health
Build the binary:
go build -o linux-health ./cmd/linux-health
Usage
Run directly using Go:
go run ./cmd/linux-health
Or run the compiled binary:
./linux-health
Sample Output
ββββββββββββββββββββββββββββββββββββββββ
β LINUX SYSTEM HEALTH β
ββββββββββββββββββββββββββββββββββββββββ€
β SCORE : 100 / 100 [ GOOD ] β
β UPTIME : 0h 7m β
ββββββββββββββββββββββββββββββββββββββββ€
β CPU : 3.8 % [ OK ] β
β MEMORY : 13.8 % [ OK ] β
β DISK : 77.9 % [ OK ] β
β LOAD : 0.74 [ OK ] β
ββββββββββββββββββββββββββββββββββββββββ€
β TOP MEM : gnome-shell β
β PID 2381 269 MB β
ββββββββββββββββββββββββββββββββββββββββ€
β HOTSPOTS: β
β /home/user/Downloads 12.4G β
ββββββββββββββββββββββββββββββββββββββββ€
β SERVICES: β
β No failed services β
ββββββββββββββββββββββββββββββββββββββββ€
β NETWORK : active β
ββββββββββββββββββββββββββββββββββββββββ
Design Principles
- Minimal dependencies
- Predictable and stable output
- Suitable for automation and scripting
- Clear separation between data collection and presentation
Future Enhancements
- Optional colorized output
- Watch mode for periodic refresh
- Export output as JSON
- Threshold-based alerts
License
MIT License
Author - Ravindran S
Developer β’ ML Enthusiast β’ Neovim Customizer β’ Linux Power User
Hi! I'm Ravindran S, an engineering student passionate about:
- Linux & System Engineering
- AIML (Artificial Intelligence & Machine Learning)
- Full-stack Web Development
- Hackathon-grade project development
π Connect With Me
You can reach me here:
Socials