linux-health

module
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 2, 2026 License: MIT

README ΒΆ

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

Directories ΒΆ

Path Synopsis
cmd
linux-health command
internal
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL