{"id":13466356,"url":"https://github.com/AnalogJ/scrutiny","last_synced_at":"2025-03-25T21:32:11.018Z","repository":{"id":37324820,"uuid":"289524449","full_name":"AnalogJ/scrutiny","owner":"AnalogJ","description":"Hard Drive S.M.A.R.T Monitoring, Historical Trends \u0026 Real World Failure Thresholds","archived":false,"fork":false,"pushed_at":"2025-01-08T17:46:10.000Z","size":40285,"stargazers_count":6005,"open_issues_count":220,"forks_count":191,"subscribers_count":33,"default_branch":"master","last_synced_at":"2025-03-25T05:08:20.869Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AnalogJ.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":"docs/SUPPORTED_NAS_OS.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-08-22T16:24:27.000Z","updated_at":"2025-03-24T05:21:38.000Z","dependencies_parsed_at":"2022-07-09T04:00:23.497Z","dependency_job_id":"6041983d-7450-4857-944c-9345c4da7b3b","html_url":"https://github.com/AnalogJ/scrutiny","commit_stats":{"total_commits":709,"total_committers":38,"mean_commits":"18.657894736842106","dds":"0.15937940761636105","last_synced_commit":"0641b5e79d55d356e5b45227166cca2a66fd2555"},"previous_names":[],"tags_count":46,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnalogJ%2Fscrutiny","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnalogJ%2Fscrutiny/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnalogJ%2Fscrutiny/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnalogJ%2Fscrutiny/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AnalogJ","download_url":"https://codeload.github.com/AnalogJ/scrutiny/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245548251,"owners_count":20633546,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-07-31T15:00:42.819Z","updated_at":"2025-03-25T21:32:10.979Z","avatar_url":"https://github.com/AnalogJ.png","language":"Go","funding_links":["https://github.com/sponsors/AnalogJ/"],"categories":["Go","Install from Source","others","置顶","Software","Vars","Linux","Network","Monitor"],"sub_categories":["Storage","05、运维监控体系","Monitoring \u0026 Status Pages","Monitoring","Docker"],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/AnalogJ/scrutiny\"\u003e\n  \u003cimg width=\"300\" alt=\"scrutiny_view\" src=\"webapp/frontend/src/assets/images/logo/scrutiny-logo-dark.png\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\n# scrutiny\n\n[![CI](https://github.com/AnalogJ/scrutiny/workflows/CI/badge.svg?branch=master)](https://github.com/AnalogJ/scrutiny/actions?query=workflow%3ACI)\n[![codecov](https://codecov.io/gh/AnalogJ/scrutiny/branch/master/graph/badge.svg)](https://codecov.io/gh/AnalogJ/scrutiny)\n[![GitHub license](https://img.shields.io/github/license/AnalogJ/scrutiny.svg?style=flat-square)](https://github.com/AnalogJ/scrutiny/blob/master/LICENSE)\n[![Godoc](https://img.shields.io/badge/godoc-reference-blue.svg?style=flat-square)](https://godoc.org/github.com/analogj/scrutiny)\n[![Go Report Card](https://goreportcard.com/badge/github.com/AnalogJ/scrutiny?style=flat-square)](https://goreportcard.com/report/github.com/AnalogJ/scrutiny)\n[![GitHub release](http://img.shields.io/github/release/AnalogJ/scrutiny.svg?style=flat-square)](https://github.com/AnalogJ/scrutiny/releases)\n\nWebUI for smartd S.M.A.R.T monitoring\n\n\u003e NOTE: Scrutiny is a Work-in-Progress and still has some rough edges.\n\n[![](docs/dashboard.png)](https://imgur.com/a/5k8qMzS)\n\n# Introduction\n\nIf you run a server with more than a couple of hard drives, you're probably already familiar with S.M.A.R.T and the `smartd` daemon. If not, it's an incredible open source project described as the following:\n\n\u003e smartd is a daemon that monitors the Self-Monitoring, Analysis and Reporting Technology (SMART) system built into many ATA, IDE and SCSI-3 hard drives. The purpose of SMART is to monitor the reliability of the hard drive and predict drive failures, and to carry out different types of drive self-tests.\n\nThese S.M.A.R.T hard drive self-tests can help you detect and replace failing hard drives before they cause permanent data loss. However, there's a couple issues with `smartd`:\n\n- There are more than a hundred S.M.A.R.T attributes, however `smartd` does not differentiate between critical and informational metrics\n- `smartd` does not record S.M.A.R.T attribute history, so it can be hard to determine if an attribute is degrading slowly over time.\n- S.M.A.R.T attribute thresholds are set by the manufacturer. In some cases these thresholds are unset, or are so high that they can only be used to confirm a failed drive, rather than detecting a drive about to fail.\n- `smartd` is a command line only tool. For head-less servers a web UI would be more valuable.\n\n**Scrutiny is a Hard Drive Health Dashboard \u0026 Monitoring solution, merging manufacturer provided S.M.A.R.T metrics with real-world failure rates.**\n\n# Features\n\nScrutiny is a simple but focused application, with a couple of core features:\n\n- Web UI Dashboard - focused on Critical metrics\n- `smartd` integration (no re-inventing the wheel)\n- Auto-detection of all connected hard-drives\n- S.M.A.R.T metric tracking for historical trends\n- Customized thresholds using real world failure rates\n- Temperature tracking\n- Provided as an all-in-one Docker image (but can be installed manually)\n- Configurable Alerting/Notifications via Webhooks\n- (Future) Hard Drive performance testing \u0026 tracking\n\n# Getting Started\n\n## RAID/Virtual Drives\n\nScrutiny uses `smartctl --scan` to detect devices/drives.\n\n- All RAID controllers supported by `smartctl` are automatically supported by Scrutiny.\n    - While some RAID controllers support passing through the underlying SMART data to `smartctl` others do not.\n    - In some cases `--scan` does not correctly detect the device type, returning [incomplete SMART data](https://github.com/AnalogJ/scrutiny/issues/45).\n    Scrutiny supports overriding detected device type via the config file: see [example.collector.yaml](https://github.com/AnalogJ/scrutiny/blob/master/example.collector.yaml)\n- If you use docker, you **must** pass though the RAID virtual disk to the container using `--device` (see below)\n    - This device may be in `/dev/*` or `/dev/bus/*`.\n    - If you're unsure, run `smartctl --scan` on your host, and pass all listed devices to the container.\n\nSee [docs/TROUBLESHOOTING_DEVICE_COLLECTOR.md](./docs/TROUBLESHOOTING_DEVICE_COLLECTOR.md) for help\n\n## Docker\n\nIf you're using Docker, getting started is as simple as running the following command:\n\n\u003e See [docker/example.omnibus.docker-compose.yml](https://github.com/AnalogJ/scrutiny/blob/master/docker/example.omnibus.docker-compose.yml) for a docker-compose file.\n\n```bash\ndocker run -it --rm -p 8080:8080 -p 8086:8086 \\\n  -v `pwd`/scrutiny:/opt/scrutiny/config \\\n  -v `pwd`/influxdb2:/opt/scrutiny/influxdb \\\n  -v /run/udev:/run/udev:ro \\\n  --cap-add SYS_RAWIO \\\n  --device=/dev/sda \\\n  --device=/dev/sdb \\\n  --name scrutiny \\\n  ghcr.io/analogj/scrutiny:master-omnibus\n```\n\n- `/run/udev` is necessary to provide the Scrutiny collector with access to your device metadata\n- `--cap-add SYS_RAWIO` is necessary to allow `smartctl` permission to query your device SMART data\n    - NOTE: If you have **NVMe** drives, you must add `--cap-add SYS_ADMIN` as well. See issue [#26](https://github.com/AnalogJ/scrutiny/issues/26#issuecomment-696817130)\n- `--device` entries are required to ensure that your hard disk devices are accessible within the container.\n- `ghcr.io/analogj/scrutiny:master-omnibus` is a omnibus image, containing both the webapp server (frontend \u0026 api) as well as the S.M.A.R.T metric collector. (see below)\n\n### Hub/Spoke Deployment\n\nIn addition to the Omnibus image (available under the `latest` tag) you can deploy in Hub/Spoke mode, which requires 3\nother Docker images:\n\n- `ghcr.io/analogj/scrutiny:master-collector` - Contains the Scrutiny data collector, `smartctl` binary and cron-like\n  scheduler. You can run one collector on each server.\n- `ghcr.io/analogj/scrutiny:master-web` - Contains the Web UI and API. Only one container necessary\n- `influxdb:2.2` - InfluxDB image, used by the Web container to persist SMART data. Only one container necessary\n  See [docs/TROUBLESHOOTING_INFLUXDB.md](./docs/TROUBLESHOOTING_INFLUXDB.md)\n\n\u003e See [docker/example.hubspoke.docker-compose.yml](https://github.com/AnalogJ/scrutiny/blob/master/docker/example.hubspoke.docker-compose.yml) for a docker-compose file.\n\n```bash\ndocker run --rm -p 8086:8086 \\\n  -v `pwd`/influxdb2:/var/lib/influxdb2 \\\n  --name scrutiny-influxdb \\\n  influxdb:2.2\n\ndocker run --rm -p 8080:8080 \\\n  -v `pwd`/scrutiny:/opt/scrutiny/config \\\n  --name scrutiny-web \\\n  ghcr.io/analogj/scrutiny:master-web\n\ndocker run --rm \\\n  -v /run/udev:/run/udev:ro \\\n  --cap-add SYS_RAWIO \\\n  --device=/dev/sda \\\n  --device=/dev/sdb \\\n  -e COLLECTOR_API_ENDPOINT=http://SCRUTINY_WEB_IPADDRESS:8080 \\\n  --name scrutiny-collector \\\n  ghcr.io/analogj/scrutiny:master-collector\n```\n\n## Manual Installation (without-Docker)\n\nWhile the easiest way to get started with [Scrutiny is using Docker](https://github.com/AnalogJ/scrutiny#docker),\nit is possible to run it manually without much work. You can even mix and match, using Docker for one component and\na manual installation for the other.\n\nSee [docs/INSTALL_MANUAL.md](docs/INSTALL_MANUAL.md) for instructions.\n\n## Usage\n\nOnce scrutiny is running, you can open your browser to `http://localhost:8080` and take a look at the dashboard.\n\nIf you're using the omnibus image, the collector should already have run, and your dashboard should be populate with every\ndrive that Scrutiny detected. The collector is configured to run once a day, but you can trigger it manually by running the command below.\n\nFor users of the docker Hub/Spoke deployment or manual install: initially the dashboard will be empty.\nAfter the first collector run, you'll be greeted with a list of all your hard drives and their current smart status.\n\n```bash\ndocker exec scrutiny /opt/scrutiny/bin/scrutiny-collector-metrics run\n```\n\n# Configuration\nBy default Scrutiny looks for its YAML configuration files in `/opt/scrutiny/config`\n\nThere are two configuration files available:\n\n- Webapp/API config via `scrutiny.yaml` - [example.scrutiny.yaml](example.scrutiny.yaml).\n- Collector config via `collector.yaml` - [example.collector.yaml](example.collector.yaml).\n\nNeither file is required, however if provided, it allows you to configure how Scrutiny functions.\n\n## Cron Schedule\nUnfortunately the Cron schedule cannot be configured via the `collector.yaml` (as the collector binary needs to be trigged by a scheduler/cron).\nHowever, if you are using the official `ghcr.io/analogj/scrutiny:master-collector` or `ghcr.io/analogj/scrutiny:master-omnibus` docker images,\nyou can use the `COLLECTOR_CRON_SCHEDULE` environmental variable to override the default cron schedule (daily @ midnight - `0 0 * * *`).\n\n`docker run -e COLLECTOR_CRON_SCHEDULE=\"0 0 * * *\" ...`\n\n## Notifications\n\nScrutiny supports sending SMART device failure notifications via the following services:\n- Custom Script (data provided via environmental variables)\n- Email\n- Webhooks\n- Discord\n- Gotify\n- Hangouts\n- IFTTT\n- Join\n- Mattermost\n- ntfy\n- Pushbullet\n- Pushover\n- Slack\n- Teams\n- Telegram\n- Tulip\n\nCheck the `notify.urls` section of [example.scrutiny.yml](example.scrutiny.yaml) for examples.\n\nFor more information and troubleshooting, see the [TROUBLESHOOTING_NOTIFICATIONS.md](./docs/TROUBLESHOOTING_NOTIFICATIONS.md) file\n\n### Testing Notifications\n\nYou can test that your notifications are configured correctly by posting an empty payload to the notifications health check API.\n\n```bash\ncurl -X POST http://localhost:8080/api/health/notify\n```\n\n# Debug mode \u0026 Log Files\nScrutiny provides various methods to change the log level to debug and generate log files.\n\n## Web Server/API\n\nYou can use environmental variables to enable debug logging and/or log files for the web server:\n\n```bash\nDEBUG=true\nSCRUTINY_LOG_FILE=/tmp/web.log\n```\n\nYou can configure the log level and log file in the config file:\n\n```yml\nlog:\n  file: '/tmp/web.log'\n  level: DEBUG\n```\n\nOr if you're not using docker, you can pass CLI arguments to the web server during startup:\n\n```bash\nscrutiny start --debug --log-file /tmp/web.log\n```\n\n## Collector\n\nYou can use environmental variables to enable debug logging and/or log files for the collector:\n\n```bash\nDEBUG=true\nCOLLECTOR_LOG_FILE=/tmp/collector.log\n```\n\nOr if you're not using docker, you can pass CLI arguments to the collector during startup:\n\n```bash\nscrutiny-collector-metrics run --debug --log-file /tmp/collector.log\n```\n\n# Supported Architectures\n\n| Architecture Name | Binaries | Docker |\n| --- | --- | --- |\n| linux-amd64 | :white_check_mark: | :white_check_mark: |\n| linux-arm-5 | :white_check_mark: |  |\n| linux-arm-6 | :white_check_mark: |  |\n| linux-arm-7 | :white_check_mark: | web/collector only. see [#236](https://github.com/AnalogJ/scrutiny/issues/236)  |\n| linux-arm64 | :white_check_mark: | :white_check_mark: |\n| freebsd-amd64 | :white_check_mark: |  |\n| macos-amd64 | :white_check_mark: | :white_check_mark: |\n| macos-arm64 | :white_check_mark: | :white_check_mark: |\n| windows-amd64 | :white_check_mark: | WIP, see [#15](https://github.com/AnalogJ/scrutiny/issues/15) |\n| windows-arm64 | :white_check_mark: |  |\n\n\n# Contributing\n\nPlease see the [CONTRIBUTING.md](CONTRIBUTING.md) for instructions for how to develop and contribute to the scrutiny codebase.\n\nWork your magic and then submit a pull request. We love pull requests!\n\nIf you find the documentation lacking, help us out and update this README.md. If you don't have the time to work on Scrutiny, but found something we should know about, please submit an issue.\n\n# Versioning\n\nWe use SemVer for versioning. For the versions available, see the tags on this repository.\n\n# Authors\n\nJason Kulatunga - Initial Development - @AnalogJ\n\n# Licenses\n\n- MIT\n- Logo: [Glasses by matias porta lezcano](https://thenounproject.com/term/glasses/775232)\n\n# Sponsors\n\nScrutiny is only possible with the help of my [Github Sponsors](https://github.com/sponsors/AnalogJ/).\n\n[![](docs/sponsors.png)](https://github.com/sponsors/AnalogJ/)\n\nThey read a simple [reddit announcement post](https://github.com/sponsors/AnalogJ/) and decided to trust \u0026 finance\n a developer they've never met. It's an exciting and incredibly humbling experience.\n\nIf you found Scrutiny valuable, please consider [supporting my work](https://github.com/sponsors/AnalogJ/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAnalogJ%2Fscrutiny","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAnalogJ%2Fscrutiny","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAnalogJ%2Fscrutiny/lists"}