Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🖥️ System Health Analyzer (Linux)

A small CLI-based system monitoring tool that captures raw OS signals and turns them into clear health decisions.

This project focuses on resource pressure, not dashboards or raw metrics.


📖 Overview

The system is built as a simple pipeline:

Collect
   │
   ▼
Snapshot
   │
   ▼
Analyze

Workflow

  1. Collectors (Bash) read low-level system data.
  2. Coordinator (Python) merges data into a single snapshot.
  3. Analyzer (Python) evaluates system health and emits decisions.

The result is a monitoring tool suitable for automation, not just observation.


📂 Repository Structure

system-health-analyzer/
├── analyzer/
│   └── analyze.py
├── collectors/
│   ├── disk_collector.sh
│   ├── memory_collector.sh
│   └── process_collector.sh
├── data/
│   └── metrics.json
└── coordinator.py

⚙️ Components

1️⃣ Collectors (Bash)

Located in collectors/

Each collector:

  • Reads system state directly from the OS
  • Emits valid JSON to stdout
  • Contains no thresholds or decisions

Included Collectors

Collector Description
memory_collector.sh Reads /proc/meminfo
disk_collector.sh Reads df
process_collector.sh Reads ps

2️⃣ Coordinator (Python)

The coordinator:

  • Runs all collectors
  • Parses their JSON output
  • Merges data into one snapshot
  • Writes the snapshot to data/metrics.json

This ensures data integrity and prevents malformed JSON.


3️⃣ Analyzer (Python)

The analyzer:

  • Loads the snapshot
  • Applies health rules
  • Emits OK / WARNING states
  • Returns automation-safe exit codes

Exit Codes

Code Meaning
0 Healthy
1 Warning (resource pressure)
2 Invalid or incomplete data

🚀 How to Use

1. Generate a system snapshot

python3 coordinator.py

2. Analyze system health

python3 analyzer/analyze.py

🎯 Design Principles

  • Clear separation between data collection and decision logic
  • Raw OS signals over synthetic metrics
  • JSON as a strict data contract
  • Fail fast on invalid data
  • Designed for cron, CI, or automation hooks

💡 Why This Project?

This project was built to understand:

  • How Linux exposes real system pressure
  • Why monitoring should drive decisions, not dashboards
  • How to design small, composable system tools reopening

📝 Notes

  • Developed and tested on Arch Linux
  • Intentionally minimal by design
  • Built as a systems-learning artifact, not a full monitoring suite

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages