Skip to content

mcollard0/quiet_smart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

quiet_smart - SMART Drive Monitor

A Python application that monitors SSD/NVMe drives for health changes and sends persistent desktop notifications when issues are detected.

Features

  • Automated Monitoring: Daily cron job monitors drive health
  • Persistent Notifications: Critical alerts remain visible until dismissed
  • Detailed Reports: Human-readable reports with drive metrics and changes
  • Test Mode: Simulate changes to test notification system
  • State Tracking: JSON-based state persistence for change detection
  • Multi-Drive Support: Monitors all non-USB drives (SATA SSD + NVMe)

Installation

  1. Clone/Copy to desired directory
  2. Install dependencies:
    python3 -m venv venv
    source venv/bin/activate
    pip install -r requirements.txt
  3. Ensure smartmontools is installed:
    sudo apt install smartmontools libnotify-bin

Usage Examples

Basic Monitoring

# Run monitoring once
python3 quiet_smart.py

# Use virtual environment
./venv/bin/python quiet_smart.py

Cron Job Management

# Install daily cron job (9 AM)
python3 quiet_smart.py -c

# Remove cron job
python3 quiet_smart.py -d

# Verify cron job installation
crontab -l | grep quiet_smart

Test Mode

# Simulate changes (all metrics appear to change from -1)
python3 quiet_smart.py --test

Monitored Metrics

Warning Triggers (Generate Notifications)

  • Reallocated Sectors: Any increase
  • Media/Data Integrity Errors: Any increase
  • Critical Warning: Any non-zero value
  • Available Spare %: Any decrease
  • Warning/Critical Temperature Time: Any increase
  • Unsafe Shutdowns: Any increase

Tracked Information

  • Power On Hours
  • Power Cycles
  • Temperature
  • Drive Model/Serial
  • Capacity
  • Health Status

File Structure

quiet_smart/
├── quiet_smart.py          # Main application
├── requirements.txt        # Python dependencies
├── architecture.md         # Technical documentation
├── README.md              # This file
├── state.json             # Previous run metrics (auto-generated)
├── report_YYYYMMDD_HHMM.txt # Reports (auto-generated)
├── cron.log              # Cron job output (auto-generated)
├── backup/               # Code backups
│   └── quiet_smart.YYYYMMDD.py
└── venv/                 # Virtual environment

Example Report Output

=== SMART Drive Report - 2025-10-01 12:33:20 ===

=== Samsung SSD 850 EVO M.2 500GB (sda) ===
Serial: S33DNX0HC03586A
Capacity: 465 GB
Power On Hours: 21420
Power Cycles: 1891
Reallocated Sectors: 0
Temperature: 30°C
Available Spare %: 100
Unsafe Shutdowns: 0
Media/Data Integrity Errors: 0
Health: Excellent

Notification Examples

When issues are detected, persistent notifications appear:

  • "Drive /dev/sda: Reallocated Sectors increased from 0 to 1 (∞% change)"
  • "Drive /dev/nvme0n1: Unsafe Shutdowns increased from 77 to 85 (10.4% change)"
  • "Drive /dev/sdb: Available Spare decreased from 100% to 98% (-2.0% change)"

Requirements

  • Linux: Ubuntu/Debian-based distribution
  • Python: 3.6+
  • System Packages: smartmontools, libnotify-bin
  • Python Packages: python-crontab
  • Permissions: sudo access for smartctl commands
  • Desktop: GUI environment for notifications

Troubleshooting

No notifications appearing

  • Install notification system: sudo apt install libnotify-bin
  • Ensure desktop environment is running

Permission errors

  • Add user to sudoers for smartctl: sudo visudo
  • Add line: username ALL=(ALL) NOPASSWD: /usr/sbin/smartctl

Cron job not running

  • Check cron service: sudo systemctl status cron
  • Verify job installation: crontab -l
  • Check log file: tail -f cron.log

License

This project follows user preferences for coding style including spaces in function calls and semicolons.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages