Skip to content

ravindran-dev/linux-health

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Contact

About

A lightweight, fast, and dependency-free Linux system health monitoring tool written in Go.

Topics

Resources

License

Stars

Watchers

Forks