# maheshbabu532/drive_health_framework architecture

> Architecture diagram of the GitHub repository maheshbabu532/drive_health_framework, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/maheshbabu532/drive_health_framework
- Repository: https://github.com/maheshbabu532/drive_health_framework

## Overview

This is a remote drive-health validation framework. Its principal workflow loads drive settings, connects to a Linux host over SSH, discovers or selects drives, gathers SMART/NVMe and kernel-error data, evaluates thresholds, and presents/logs a report. The graph also shows the command/SSH support layer and documented logging and JSON-report capabilities. Some stages are documented but their implementation was not sampled; those links rely on the README rather than implying unsampled call details.

Main entry points: [`services/drive_health_service.py`](https://github.com/maheshbabu532/drive_health_framework/blob/main/services/drive_health_service.py) (Health-check service), [`main.py`](https://github.com/maheshbabu532/drive_health_framework/blob/main/main.py) (CLI entry point), [`services/base_service.py`](https://github.com/maheshbabu532/drive_health_framework/blob/main/services/base_service.py) (Service plumbing), [`utils/ssh_client.py`](https://github.com/maheshbabu532/drive_health_framework/blob/main/utils/ssh_client.py) (SSH client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Validation workflow"]
  node_entry["CLI entry point<br/>[main.py]"]
  node_service["Health-check service"]
  node_discovery["Drive discovery"]
  node_smart["SMART checks"]
  node_nvme["NVMe checks"]
  node_kernel["Kernel error scan"]
  node_evaluation["Threshold evaluation"]
end

subgraph group_remote["Remote access"]
  node_base["Service plumbing<br/>[base_service.py]"]
  node_executor["Command executor"]
  node_ssh_client["SSH client<br/>[ssh_client.py]"]
end

subgraph group_support["Configuration and support"]
  node_drive_config["Drive configuration<br/>[drives.json]"]
  node_json_reader["JSON reader<br/>[json_reader.py]"]
  node_ssh_settings["SSH settings<br/>[settings.py]"]
  node_device_safety["Device validation<br/>[devices.py]"]
  node_commands["Command templates<br/>[commands.json]"]
end

subgraph group_outputs["Diagnostics and reports"]
  node_logger["Redacting logger<br/>[logger.py]"]
  node_logs["Log files"]
  node_report["Health report"]
end

node_operator(("Operator"))
node_target(("Linux host"))

node_operator -->|"runs"| node_entry
node_entry -->|"loads"| node_drive_config
node_entry -->|"reads config"| node_json_reader
node_entry -->|"starts checks"| node_service
node_entry -->|"generates"| node_report
node_service -->|"discovers drives"| node_discovery
node_service -->|"checks SMART"| node_smart
node_service -->|"checks NVMe"| node_nvme
node_service -->|"scans dmesg"| node_kernel
node_service -->|"evaluates health"| node_evaluation
node_service -->|"uses thresholds"| node_drive_config
node_service -->|"inherits plumbing"| node_base
node_base -->|"creates executor"| node_executor
node_base -->|"loads templates"| node_commands
node_base -->|"accepts session"| node_ssh_client
node_service -->|"runs commands"| node_executor
node_service -->|"validates device"| node_device_safety
node_executor -->|"executes remotely"| node_ssh_client
node_ssh_client -->|"loads settings"| node_ssh_settings
node_ssh_client -->|"connects and commands"| node_target
node_service -->|"logs diagnostics"| node_logger
node_entry -->|"configures logging"| node_logger
node_logger -->|"writes rotating logs"| node_logs
node_entry -->|"renders results"| node_report

click node_entry "https://github.com/maheshbabu532/drive_health_framework/blob/main/main.py"
click node_drive_config "https://github.com/maheshbabu532/drive_health_framework/blob/main/config/drives.json"
click node_json_reader "https://github.com/maheshbabu532/drive_health_framework/blob/main/utils/json_reader.py"
click node_service "https://github.com/maheshbabu532/drive_health_framework/blob/main/services/drive_health_service.py"
click node_discovery "https://github.com/maheshbabu532/drive_health_framework/blob/main/services/drive_health_service.py"
click node_smart "https://github.com/maheshbabu532/drive_health_framework/blob/main/services/drive_health_service.py"
click node_nvme "https://github.com/maheshbabu532/drive_health_framework/blob/main/services/drive_health_service.py"
click node_kernel "https://github.com/maheshbabu532/drive_health_framework/blob/main/services/drive_health_service.py"
click node_evaluation "https://github.com/maheshbabu532/drive_health_framework/blob/main/services/drive_health_service.py"
click node_base "https://github.com/maheshbabu532/drive_health_framework/blob/main/services/base_service.py"
click node_executor "https://github.com/maheshbabu532/drive_health_framework/blob/main/utils/command_executor.py"
click node_ssh_client "https://github.com/maheshbabu532/drive_health_framework/blob/main/utils/ssh_client.py"
click node_ssh_settings "https://github.com/maheshbabu532/drive_health_framework/blob/main/utils/settings.py"
click node_device_safety "https://github.com/maheshbabu532/drive_health_framework/blob/main/utils/devices.py"
click node_commands "https://github.com/maheshbabu532/drive_health_framework/blob/main/config/commands.json"
click node_logger "https://github.com/maheshbabu532/drive_health_framework/blob/main/utils/logger.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_entry,node_service,node_discovery,node_smart,node_nvme,node_kernel,node_evaluation toneBlue
class node_base,node_executor,node_ssh_client toneAmber
class node_drive_config,node_json_reader,node_ssh_settings,node_device_safety,node_commands toneMint
class node_logger,node_logs,node_report toneRose
class node_operator,node_target toneIndigo
```

## Components

### Validation workflow

- [CLI entry point](https://github.com/maheshbabu532/drive_health_framework/blob/main/main.py): `main.py`
- [Health-check service](https://github.com/maheshbabu532/drive_health_framework/blob/main/services/drive_health_service.py): `services/drive_health_service.py`
- [Drive discovery](https://github.com/maheshbabu532/drive_health_framework/blob/main/services/drive_health_service.py): `services/drive_health_service.py`
- [SMART checks](https://github.com/maheshbabu532/drive_health_framework/blob/main/services/drive_health_service.py): `services/drive_health_service.py`
- [NVMe checks](https://github.com/maheshbabu532/drive_health_framework/blob/main/services/drive_health_service.py): `services/drive_health_service.py`
- [Kernel error scan](https://github.com/maheshbabu532/drive_health_framework/blob/main/services/drive_health_service.py): `services/drive_health_service.py`
- [Threshold evaluation](https://github.com/maheshbabu532/drive_health_framework/blob/main/services/drive_health_service.py): `services/drive_health_service.py`

### Remote access

- [Service plumbing](https://github.com/maheshbabu532/drive_health_framework/blob/main/services/base_service.py): `services/base_service.py`
- [Command executor](https://github.com/maheshbabu532/drive_health_framework/blob/main/utils/command_executor.py): `utils/command_executor.py`
- [SSH client](https://github.com/maheshbabu532/drive_health_framework/blob/main/utils/ssh_client.py): `utils/ssh_client.py`

### Configuration and support

- [Drive configuration](https://github.com/maheshbabu532/drive_health_framework/blob/main/config/drives.json): `config/drives.json`
- [JSON reader](https://github.com/maheshbabu532/drive_health_framework/blob/main/utils/json_reader.py): `utils/json_reader.py`
- [SSH settings](https://github.com/maheshbabu532/drive_health_framework/blob/main/utils/settings.py): `utils/settings.py`
- [Device validation](https://github.com/maheshbabu532/drive_health_framework/blob/main/utils/devices.py): `utils/devices.py`
- [Command templates](https://github.com/maheshbabu532/drive_health_framework/blob/main/config/commands.json): `config/commands.json`

### Diagnostics and reports

- [Redacting logger](https://github.com/maheshbabu532/drive_health_framework/blob/main/utils/logger.py): `utils/logger.py`
- **Log files**
- **Health report**

### Other components

- **Operator**
- **Linux host**

## Connections

- Operator → CLI entry point: runs (evidence: `README.md`)
- CLI entry point → Drive configuration: loads (evidence: `main.py`)
- CLI entry point → JSON reader: reads config (evidence: `main.py`)
- CLI entry point → Health-check service: starts checks (evidence: `README.md`)
- CLI entry point → Health report: generates (evidence: `README.md`)
- Health-check service → Drive discovery: discovers drives (evidence: `README.md`)
- Health-check service → SMART checks: checks SMART (evidence: `services/drive_health_service.py`)
- Health-check service → NVMe checks: checks NVMe (evidence: `services/drive_health_service.py`)
- Health-check service → Kernel error scan: scans dmesg (evidence: `README.md`)
- Health-check service → Threshold evaluation: evaluates health (evidence: `README.md`)
- Health-check service → Drive configuration: uses thresholds (evidence: `README.md`)
- Health-check service → Service plumbing: inherits plumbing (evidence: `services/drive_health_service.py`)
- Service plumbing → Command executor: creates executor (evidence: `services/base_service.py`)
- Service plumbing → Command templates: loads templates (evidence: `services/base_service.py`)
- Service plumbing → SSH client: accepts session (evidence: `services/base_service.py`)
- Health-check service → Command executor: runs commands (evidence: `services/drive_health_service.py`)
- Health-check service → Device validation: validates device (evidence: `services/drive_health_service.py`)
- Command executor → SSH client: executes remotely (evidence: `utils/command_executor.py`)
- SSH client → SSH settings: loads settings (evidence: `utils/ssh_client.py`)
- SSH client → Linux host: connects and commands (evidence: `README.md`)
- Health-check service → Redacting logger: logs diagnostics (evidence: `README.md`)
- CLI entry point → Redacting logger: configures logging (evidence: `main.py`)
- Redacting logger → Log files: writes rotating logs (evidence: `utils/logger.py`)
- CLI entry point → Health report: renders results (evidence: `README.md`)
