feat: S.M.A.R.T. disk health monitoring with CLI and GUI

- Add core module with SMART data parsing and health calculation
- Add CLI with Rich-based terminal UI and health bar visualization
- Add GUI with PyQt6 tabs for summary and detailed views
- Support multiple health indicators (ID 231, 169, 233) for different SSD manufacturers
- Add bilingual support (Russian/English) with auto-detection
- Add GitHub Actions workflow for building binaries on Linux, Windows, macOS
- Calculate health based on reallocated sectors, pending sectors, SSD life, and more

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
kilyabin
2026-03-15 00:15:21 +04:00
commit 19b79a4e13
12 changed files with 2333 additions and 0 deletions

185
README.md Normal file
View File

@@ -0,0 +1,185 @@
# Smart Report 📊
S.M.A.R.T. disk health monitoring tool with both CLI and GUI interfaces.
![License](https://img.shields.io/badge/license-MIT-blue.svg)
![Python](https://img.shields.io/badge/python-3.8+-blue.svg)
## Features
- 🖥️ **CLI Interface** - Quick terminal-based health report using Rich
- 🖱️ **GUI Interface** - Modern PyQt6 interface with real-time refresh
- 💾 **Multi-disk Support** - Check all disks at once (HDD, SSD, NVMe)
- 📈 **Health Metrics** - Temperature, wear percentage, reallocated sectors, power-on hours
- 🎨 **Color-coded Status** - Easy visual identification of disk health
## Screenshots
### CLI Interface
```
$ sudo smart-report-cli
```
### GUI Interface
```
$ sudo smart-report-gui
```
## Requirements
### System Dependencies
- `smartmontools` - For S.M.A.R.T. data access
- `nvme-cli` - For NVMe SSD support (optional)
Install on Ubuntu/Debian:
```bash
sudo apt-get install smartmontools nvme-cli
```
Install on Fedora/RHEL:
```bash
sudo dnf install smartmontools nvme-cli
```
Install on Arch Linux:
```bash
sudo pacman -S smartmontools nvme-cli
```
## Installation
### From Source
```bash
git clone https://github.com/kilyabin/smart-report.git
cd smart-report
pip install -r requirements.txt
pip install -e .
```
### Run Without Installation
```bash
# CLI version
sudo python3 smart_report/cli.py
# GUI version
sudo python3 smart_report/gui.py
```
## Usage
### CLI Version
```bash
# Run with sudo for full access
sudo smart-report
# Or without sudo (limited data)
smart-report
```
### GUI Version
```bash
# Run with sudo for full access
sudo smart-report-gui
# Or without sudo (limited data)
smart-report-gui
```
## Building Binaries
### Local Build
```bash
# Build CLI binary
pyinstaller --name smart-report --onefile smart_report/cli.py
# Build GUI binary
pyinstaller --name smart-report-gui --onefile --windowed smart_report/gui.py
# Binaries will be in ./dist/
```
### GitHub Actions
Binaries are automatically built on every push and release. Download from:
- **Releases page**: Pre-built binaries for Linux, Windows, macOS
- **Actions tab**: Latest CI builds
## Project Structure
```
smart-report/
├── smart_report/
│ ├── __init__.py # Package info
│ ├── core.py # Core SMART data collection
│ ├── cli.py # CLI interface (Rich)
│ └── gui.py # GUI interface (PyQt6)
├── requirements.txt # Python dependencies
├── pyproject.toml # Package configuration
├── setup.py # Setup script
├── README.md # This file
└── .github/
└── workflows/
└── build.yml # GitHub Actions workflow
```
## Development
```bash
# Install in development mode
pip install -e .
# Run CLI
python -m smart_report.cli
# Run GUI
python -m smart_report.gui
```
## Troubleshooting
### "Permission denied" errors
Run with `sudo` for full S.M.A.R.T. access:
```bash
sudo smart-report-cli
sudo smart-report-gui
```
### "smartctl not found"
Install smartmontools (see Requirements above).
### GUI doesn't start
Make sure PyQt6 is installed:
```bash
pip install PyQt6
```
### NVMe drives show limited data
Install nvme-cli:
```bash
sudo apt-get install nvme-cli # Ubuntu/Debian
```
## License
MIT License - see [LICENSE](LICENSE) file for details.
## Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
1. Fork the repository
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request
## Acknowledgments
- [smartmontools](https://www.smartmontools.org/) - S.M.A.R.T. data access
- [Rich](https://github.com/Textualize/rich) - Beautiful CLI interface
- [PyQt6](https://www.riverbankcomputing.com/static/Docs/PyQt6/) - GUI framework