{"id":48373724,"url":"https://github.com/nicholasodonnell/smart-runner","last_synced_at":"2026-04-05T17:43:36.728Z","repository":{"id":216022281,"uuid":"740268938","full_name":"nicholasodonnell/smart-runner","owner":"nicholasodonnell","description":"Pyton script for S.M.A.R.T cronjobs","archived":false,"fork":false,"pushed_at":"2025-02-13T04:40:40.000Z","size":107,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-05T17:43:35.174Z","etag":null,"topics":["bash","hdd-health","monitoring-scripts","python","smartctl","smartmontools"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nicholasodonnell.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2024-01-08T01:42:53.000Z","updated_at":"2025-02-13T04:40:44.000Z","dependencies_parsed_at":"2024-01-21T06:19:48.214Z","dependency_job_id":"15c0ef72-71be-4bb7-bfec-d245d4ae39ea","html_url":"https://github.com/nicholasodonnell/smart-runner","commit_stats":null,"previous_names":["nicholasodonnell/smart-runner"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/nicholasodonnell/smart-runner","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicholasodonnell%2Fsmart-runner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicholasodonnell%2Fsmart-runner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicholasodonnell%2Fsmart-runner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicholasodonnell%2Fsmart-runner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nicholasodonnell","download_url":"https://codeload.github.com/nicholasodonnell/smart-runner/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicholasodonnell%2Fsmart-runner/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31444702,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T15:22:31.103Z","status":"ssl_error","status_checked_at":"2026-04-05T15:22:00.205Z","response_time":75,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","hdd-health","monitoring-scripts","python","smartctl","smartmontools"],"created_at":"2026-04-05T17:43:36.080Z","updated_at":"2026-04-05T17:43:36.723Z","avatar_url":"https://github.com/nicholasodonnell.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cpicture\u003e\n  \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"./images/banner-dark.png\"\u003e\n  \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"./images/banner-light.png\"\u003e\n  \u003cimg src=\"./images/banner-dark.png\"\u003e\n\u003c/picture\u003e\n\n[![Publish](https://github.com/nicholasodonnell/smart-runner/actions/workflows/publish.yml/badge.svg)](https://github.com/nicholasodonnell/smart-runner/actions/workflows/publish.yml)\n\n## Description\n\nS.M.A.R.T Runner is a Python script designed to automate the scheduling and execution of S.M.A.R.T (Self-Monitoring, Analysis, and Reporting Technology) tests on hard drives. It allows for regular short and long health checks on specified disks, helping in the early detection of potential disk failures.\n\n## Features\n\n- **Automated Scheduling:** Configure once and let the script handle regular short and long S.M.A.R.T tests.\n- **Customizable Frequency:** Define how often each type of test should be performed on each disk.\n- **Parallel Testing:** Specify how many disks to test simultaneously for both short and long tests.\n- **Offset Timing:** Configure waiting periods between tests to avoid overloading the system or testing too frequently.\n- **Logging:** Keep track of tests, results, and any errors in a specified log file.\n- **Email Notifications:** Receive email alerts for test failures.\n- **Configurable SMTP:** Set up custom SMTP server settings for sending out email notifications.\n- **Easy Cron Integration:** Run the script as a daily cron job for hands-off operation.\n- **Intelligent Disk Detection:** Automatically detect and handle disks based on mount points if specified.\n- **Lock File:** Prevent multiple instances of the script from running simultaneously.\n\n## Setup Requirements\n\nBefore using the S.M.A.R.T Runner, ensure the following requirements are met:\n\n- **Python 3:** The script is written for Python 3. Ensure it is installed and properly configured on your system.\n- **smartmontools:** This suite contains the `smartctl` utility, which is used to perform the S.M.A.R.T tests. It must be installed on your system.\n    - Install it using your package manager, e.g., `sudo apt-get install smartmontools` on Debian/Ubuntu.\n- **Root Access:** The script requires root permissions to access disk hardware for S.M.A.R.T tests.\n- **Cron Job:** Schedule the script to run at least once per day using cron or another scheduler to automate the disk checks.\n\n## Configuration\n\nThe script is configured via a `smart-runner.conf` file. Here's an explanation of each configuration option:\n\n| Section    | Option           | Description                                                                                                                        |\n| ---------- | ---------------- | ---------------------------------------------------------------------------------------------------------------------------------- |\n| `disks`    | (list)           | List the devices or mounts to test. Devices are listed as `/dev/sdX`. If a mount is given the disk will automatically be resolved. |\n| `database` | `file`           | Path to the file where test dates are stored.                                                                                      |\n| `short`    | `enabled`        | Set to `true` to enable short SMART tests.                                                                                         |\n|            | `frequency_days` | How often (in days) to run a short test on each disk.                                                                              |\n|            | `disks_per_run`  | Number of disks to test in parallel for short tests. Set to 0 for all.                                                             |\n|            | `offset_days`    | Time to wait (in days) before running a short test on a different disk.                                                            |\n| `long`     | `enabled`        | Set to `true` to enable long SMART tests.                                                                                          |\n|            | `frequency_days` | How often (in days) to run a long test on each disk.                                                                               |\n|            | `disks_per_run`  | Number of disks to test in parallel for long tests. Set to 0 for all.                                                              |\n|            | `offset_days`    | Time to wait (in days) before running a long test on a different disk.                                                             |\n| `log`      | `file`           | Path to the log file where execution details are recorded.                                                                         |\n|            | `level`          | Log level. Set to `debug` for more detailed logs.                                                                                  |\n| `email`    | `enabled`        | Set to `true` to enable email notifications for test failures.                                                                     |\n|            | `from_email`     | Sender email address for notifications.                                                                                            |\n|            | `to_email`       | Recipient email address for notifications.                                                                                         |\n| `smtp`     | `host`           | SMTP server for sending email notifications.                                                                                       |\n|            | `port`           | SMTP server port. Leave empty for default port.                                                                                    |\n|            | `ssl`            | Set to `true` to enable SSL for the SMTP connection.                                                                               |\n|            | `tls`            | Set to `true` to enable TLS for the SMTP connection.                                                                               |\n|            | `user`           | SMTP server username for authentication.                                                                                           |\n|            | `password`       | SMTP server password for authentication.                                                                                           |\n\n## Usage\n\n1. Clone this repository:\n   ```console\n   git clone https://github.com/nicholasodonnell/smart-runner.git\n   ```\n2. Create a `smart-runner.conf` configuration file according to your needs using [`smart-runner.conf.example`](./smart-runner.conf.example) as a reference:\n   ```console\n   cp smart-runner.conf.example smart-runner.conf\n   ```\n3. Schedule the script to run via a cron job (edit using `crontab -e`):\n   ```console\n   0 3 * * * /path/to/smart-runner.py --conf=/path/to/smart-runner.conf\n   ```\n4. Monitor the specified log file or your email for notifications about disk health.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicholasodonnell%2Fsmart-runner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnicholasodonnell%2Fsmart-runner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicholasodonnell%2Fsmart-runner/lists"}