Coder Social home page Coder Social logo

scrutiny's Introduction

scrutiny_view

scrutiny

CI codecov GitHub license Godoc Go Report Card GitHub release

WebUI for smartd S.M.A.R.T monitoring

NOTE: Scrutiny is a Work-in-Progress and still has some rough edges.

Introduction

If 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:

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.

These 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:

  • There are more than a hundred S.M.A.R.T attributes, however smartd does not differentiate between critical and informational metrics
  • 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.
  • 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.
  • smartd is a command line only tool. For head-less servers a web UI would be more valuable.

Scrutiny is a Hard Drive Health Dashboard & Monitoring solution, merging manufacturer provided S.M.A.R.T metrics with real-world failure rates.

Features

Scrutiny is a simple but focused application, with a couple of core features:

  • Web UI Dashboard - focused on Critical metrics
  • smartd integration (no re-inventing the wheel)
  • Auto-detection of all connected hard-drives
  • S.M.A.R.T metric tracking for historical trends
  • Customized thresholds using real world failure rates
  • Temperature tracking
  • Provided as an all-in-one Docker image (but can be installed manually)
  • Configurable Alerting/Notifications via Webhooks
  • (Future) Hard Drive performance testing & tracking

Getting Started

RAID/Virtual Drives

Scrutiny uses smartctl --scan to detect devices/drives.

  • All RAID controllers supported by smartctl are automatically supported by Scrutiny.
    • While some RAID controllers support passing through the underlying SMART data to smartctl others do not.
    • In some cases --scan does not correctly detect the device type, returning incomplete SMART data. Scrutiny supports overriding detected device type via the config file: see example.collector.yaml
  • If you use docker, you must pass though the RAID virtual disk to the container using --device (see below)
    • This device may be in /dev/* or /dev/bus/*.
    • If you're unsure, run smartctl --scan on your host, and pass all listed devices to the container.

See docs/TROUBLESHOOTING_DEVICE_COLLECTOR.md for help

Docker

If you're using Docker, getting started is as simple as running the following command:

See docker/example.omnibus.docker-compose.yml for a docker-compose file.

docker run -it --rm -p 8080:8080 -p 8086:8086 \
  -v `pwd`/scrutiny:/opt/scrutiny/config \
  -v `pwd`/influxdb2:/opt/scrutiny/influxdb \
  -v /run/udev:/run/udev:ro \
  --cap-add SYS_RAWIO \
  --device=/dev/sda \
  --device=/dev/sdb \
  --name scrutiny \
  ghcr.io/analogj/scrutiny:master-omnibus
  • /run/udev is necessary to provide the Scrutiny collector with access to your device metadata
  • --cap-add SYS_RAWIO is necessary to allow smartctl permission to query your device SMART data
    • NOTE: If you have NVMe drives, you must add --cap-add SYS_ADMIN as well. See issue #26
  • --device entries are required to ensure that your hard disk devices are accessible within the container.
  • ghcr.io/analogj/scrutiny:master-omnibus is a omnibus image, containing both the webapp server (frontend & api) as well as the S.M.A.R.T metric collector. (see below)

Hub/Spoke Deployment

In addition to the Omnibus image (available under the latest tag) you can deploy in Hub/Spoke mode, which requires 3 other Docker images:

  • ghcr.io/analogj/scrutiny:master-collector - Contains the Scrutiny data collector, smartctl binary and cron-like scheduler. You can run one collector on each server.
  • ghcr.io/analogj/scrutiny:master-web - Contains the Web UI and API. Only one container necessary
  • influxdb:2.2 - InfluxDB image, used by the Web container to persist SMART data. Only one container necessary See docs/TROUBLESHOOTING_INFLUXDB.md

See docker/example.hubspoke.docker-compose.yml for a docker-compose file.

docker run --rm -p 8086:8086 \
  -v `pwd`/influxdb2:/var/lib/influxdb2 \
  --name scrutiny-influxdb \
  influxdb:2.2

docker run --rm -p 8080:8080 \
  -v `pwd`/scrutiny:/opt/scrutiny/config \
  --name scrutiny-web \
  ghcr.io/analogj/scrutiny:master-web

docker run --rm \
  -v /run/udev:/run/udev:ro \
  --cap-add SYS_RAWIO \
  --device=/dev/sda \
  --device=/dev/sdb \
  -e COLLECTOR_API_ENDPOINT=http://SCRUTINY_WEB_IPADDRESS:8080 \
  --name scrutiny-collector \
  ghcr.io/analogj/scrutiny:master-collector

Manual Installation (without-Docker)

While the easiest way to get started with Scrutiny is using Docker, it is possible to run it manually without much work. You can even mix and match, using Docker for one component and a manual installation for the other.

See docs/INSTALL_MANUAL.md for instructions.

Usage

Once scrutiny is running, you can open your browser to http://localhost:8080 and take a look at the dashboard.

If you're using the omnibus image, the collector should already have run, and your dashboard should be populate with every drive that Scrutiny detected. The collector is configured to run once a day, but you can trigger it manually by running the command below.

For users of the docker Hub/Spoke deployment or manual install: initially the dashboard will be empty. After the first collector run, you'll be greeted with a list of all your hard drives and their current smart status.

docker exec scrutiny /opt/scrutiny/bin/scrutiny-collector-metrics run

Configuration

By default Scrutiny looks for its YAML configuration files in /opt/scrutiny/config

There are two configuration files available:

Neither file is required, however if provided, it allows you to configure how Scrutiny functions.

Cron Schedule

Unfortunately the Cron schedule cannot be configured via the collector.yaml (as the collector binary needs to be trigged by a scheduler/cron). However, if you are using the official ghcr.io/analogj/scrutiny:master-collector or ghcr.io/analogj/scrutiny:master-omnibus docker images, you can use the COLLECTOR_CRON_SCHEDULE environmental variable to override the default cron schedule (daily @ midnight - 0 0 * * *).

docker run -e COLLECTOR_CRON_SCHEDULE="0 0 * * *" ...

Notifications

Scrutiny supports sending SMART device failure notifications via the following services:

  • Custom Script (data provided via environmental variables)
  • Email
  • Webhooks
  • Discord
  • Gotify
  • Hangouts
  • IFTTT
  • Join
  • Mattermost
  • ntfy
  • Pushbullet
  • Pushover
  • Slack
  • Teams
  • Telegram
  • Tulip

Check the notify.urls section of example.scrutiny.yml for examples.

For more information and troubleshooting, see the TROUBLESHOOTING_NOTIFICATIONS.md file

Testing Notifications

You can test that your notifications are configured correctly by posting an empty payload to the notifications health check API.

curl -X POST http://localhost:8080/api/health/notify

Debug mode & Log Files

Scrutiny provides various methods to change the log level to debug and generate log files.

Web Server/API

You can use environmental variables to enable debug logging and/or log files for the web server:

DEBUG=true
SCRUTINY_LOG_FILE=/tmp/web.log

You can configure the log level and log file in the config file:

log:
  file: '/tmp/web.log'
  level: DEBUG

Or if you're not using docker, you can pass CLI arguments to the web server during startup:

scrutiny start --debug --log-file /tmp/web.log

Collector

You can use environmental variables to enable debug logging and/or log files for the collector:

DEBUG=true
COLLECTOR_LOG_FILE=/tmp/collector.log

Or if you're not using docker, you can pass CLI arguments to the collector during startup:

scrutiny-collector-metrics run --debug --log-file /tmp/collector.log

Supported Architectures

Architecture Name Binaries Docker
linux-amd64
linux-arm-5
linux-arm-6
linux-arm-7 web/collector only. see #236
linux-arm64
freebsd-amd64
macos-amd64
macos-arm64
windows-amd64 WIP, see #15
windows-arm64

Contributing

Please see the CONTRIBUTING.md for instructions for how to develop and contribute to the scrutiny codebase.

Work your magic and then submit a pull request. We love pull requests!

If 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.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

Jason Kulatunga - Initial Development - @AnalogJ

Licenses

Sponsors

Scrutiny is only possible with the help of my Github Sponsors.

They read a simple reddit announcement post and decided to trust & finance a developer they've never met. It's an exciting and incredibly humbling experience.

If you found Scrutiny valuable, please consider supporting my work

scrutiny's People

Contributors

adamantike avatar adripo avatar analogj avatar aspacca avatar badco-nz avatar boomam avatar drfrankensteinuk avatar dropsignal avatar henfri avatar ibizaman avatar joserebelo avatar kaetuun avatar kaysond avatar kf5jwc avatar mattkobayashi avatar packagr-io-beta[bot] avatar packagr-io[bot] avatar peterdavehello avatar prplhaz4 avatar realorangeone avatar robert-zacchigna avatar ryck avatar saswatpadhi avatar shamoon avatar sim22 avatar slavikca avatar stratusfearme21 avatar telyn avatar uhthomas avatar zorlin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

scrutiny's Issues

Import existing temp data from InfluxDB

I have years worth of temp data for each drive stored in InfluxDB which was gathered using Telegraf. Perhaps it would be possible to sample this data at a low resolution to inform the temp graphs used here?

[FEAT] Separate disks on dashboard by computer in hub/spoke deployment

Feature Request
Separate disks by computer or identify the host computer for each disk in the scrutiny dashboard when using multiple collectors on the same database/UI

Describe the solution you'd like
It would be nice if the Scrutiny dashboard could separate the 'cards' for each drive into groups based on the computer's hostname or a value specified in the collector's configuration file. This would make it easier to tell where a disk is and if a particular computer might be having problems.

Terrible mockup screenshot:
scrutiny
(The 0 degree temperature isn't an error - the drive itself doesn't report temperature.)

Example Smartctl data

root@ef0342b2fe4c:/# smartctl --all /dev/sdc
smartctl 7.1 2019-12-30 r5022 [x86_64-linux-4.19.128-flatcar] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Device Model:     WDC WD140EDFZ-11A0VA0
Serial Number:    9RK4XXXX
LU WWN Device Id: 5 000cca 264ec3183
Firmware Version: 81.00A81
User Capacity:    14,000,519,643,136 bytes [14.0 TB]
Sector Sizes:     512 bytes logical, 4096 bytes physical
Rotation Rate:    5400 rpm
Form Factor:      3.5 inches
Device is:        Not in smartctl database [for details use: -P showall]
ATA Version is:   ACS-2, ATA8-ACS T13/1699-D revision 4
SATA Version is:  SATA 3.2, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is:    Thu Jul 30 15:07:14 2020 UTC
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status:  (0x82)	Offline data collection activity
					was completed without error.
					Auto Offline Data Collection: Enabled.
Self-test execution status:      (   0)	The previous self-test routine completed
					without error or no self-test has ever
					been run.
Total time to complete Offline
data collection: 		(  101) seconds.
Offline data collection
capabilities: 			 (0x5b) SMART execute Offline immediate.
					Auto Offline data collection on/off support.
					Suspend Offline collection upon new
					command.
					Offline surface scan supported.
					Self-test supported.
					No Conveyance Self-test supported.
					Selective Self-test supported.
SMART capabilities:            (0x0003)	Saves SMART data before entering
					power-saving mode.
					Supports SMART auto save timer.
Error logging capability:        (0x01)	Error logging supported.
					General Purpose Logging supported.
Short self-test routine
recommended polling time: 	 (   2) minutes.
Extended self-test routine
recommended polling time: 	 (1489) minutes.
SCT capabilities: 	       (0x003d)	SCT Status supported.
					SCT Error Recovery Control supported.
					SCT Feature Control supported.
					SCT Data Table supported.

SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x000b   100   100   001    Pre-fail  Always       -       0
  2 Throughput_Performance  0x0004   135   135   054    Old_age   Offline      -       104
  3 Spin_Up_Time            0x0007   081   081   001    Pre-fail  Always       -       377 (Average 377)
  4 Start_Stop_Count        0x0012   100   100   000    Old_age   Always       -       9
  5 Reallocated_Sector_Ct   0x0033   100   100   001    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x000a   100   100   001    Old_age   Always       -       0
  8 Seek_Time_Performance   0x0004   133   133   020    Old_age   Offline      -       18
  9 Power_On_Hours          0x0012   100   100   000    Old_age   Always       -       2681
 10 Spin_Retry_Count        0x0012   100   100   001    Old_age   Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       9
 22 Unknown_Attribute       0x0023   100   100   025    Pre-fail  Always       -       100
192 Power-Off_Retract_Count 0x0032   100   100   000    Old_age   Always       -       2472
193 Load_Cycle_Count        0x0012   100   100   000    Old_age   Always       -       2472
194 Temperature_Celsius     0x0002   059   059   000    Old_age   Always       -       27 (Min/Max 22/37)
196 Reallocated_Event_Count 0x0032   100   100   000    Old_age   Always       -       0
197 Current_Pending_Sector  0x0022   100   100   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0008   100   100   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x000a   100   100   000    Old_age   Always       -       0

SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Extended offline    Completed without error       00%      1911         -
# 2  Short offline       Completed without error       00%      1877         -
# 3  Short offline       Completed without error       00%      1853         -
# 4  Short offline       Completed without error       00%      1804         -
# 5  Short offline       Completed without error       00%      1780         -
# 6  Extended offline    Completed without error       00%      1760         -
# 7  Short offline       Completed without error       00%      1708         -
# 8  Short offline       Completed without error       00%      1684         -
# 9  Short offline       Completed without error       00%      1661         -
#10  Short offline       Completed without error       00%      1636         -
#11  Short offline       Completed without error       00%      1613         -
#12  Short offline       Completed without error       00%      1589         -
#13  Extended offline    Completed without error       00%      1588         -
#14  Short offline       Completed without error       00%      1541         -
#15  Short offline       Completed without error       00%      1517         -
#16  Short offline       Completed without error       00%      1493         -
#17  Short offline       Completed without error       00%      1469         -
#18  Short offline       Completed without error       00%      1445         -
#19  Extended offline    Completed without error       00%      1430         -
#20  Short offline       Completed without error       00%      1373         -
#21  Short offline       Completed without error       00%      1349         -

SMART Selective self-test log data structure revision number 1
 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Not_testing
    2        0        0  Not_testing
    3        0        0  Not_testing
    4        0        0  Not_testing
    5        0        0  Not_testing
Selective self-test flags (0x0):
  After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.

JSON

{
  "json_format_version": [
    1,
    0
  ],
  "smartctl": {
    "version": [
      7,
      1
    ],
    "svn_revision": "5022",
    "platform_info": "x86_64-linux-4.19.128-flatcar",
    "build_info": "(local build)",
    "argv": [
      "smartctl",
      "-j",
      "--all",
      "/dev/sdc"
    ],
    "exit_status": 0
  },
  "device": {
    "name": "/dev/sdc",
    "info_name": "/dev/sdc [SAT]",
    "type": "sat",
    "protocol": "ATA"
  },
  "model_name": "WDC WD140EDFZ-11A0VA0",
  "serial_number": "9RK4XXXX",
  "wwn": {
    "naa": 5,
    "oui": 3274,
    "id": 10283135363
  },
  "firmware_version": "81.00A81",
  "user_capacity": {
    "blocks": 27344764928,
    "bytes": 14000519643136
  },
  "logical_block_size": 512,
  "physical_block_size": 4096,
  "rotation_rate": 5400,
  "form_factor": {
    "ata_value": 2,
    "name": "3.5 inches"
  },
  "in_smartctl_database": false,
  "ata_version": {
    "string": "ACS-2, ATA8-ACS T13/1699-D revision 4",
    "major_value": 1020,
    "minor_value": 41
  },
  "sata_version": {
    "string": "SATA 3.2",
    "value": 255
  },
  "interface_speed": {
    "max": {
      "sata_value": 14,
      "string": "6.0 Gb/s",
      "units_per_second": 60,
      "bits_per_unit": 100000000
    },
    "current": {
      "sata_value": 3,
      "string": "6.0 Gb/s",
      "units_per_second": 60,
      "bits_per_unit": 100000000
    }
  },
  "local_time": {
    "time_t": 1596121673,
    "asctime": "Thu Jul 30 15:07:53 2020 UTC"
  },
  "smart_status": {
    "passed": true
  },
  "ata_smart_data": {
    "offline_data_collection": {
      "status": {
        "value": 130,
        "string": "was completed without error",
        "passed": true
      },
      "completion_seconds": 101
    },
    "self_test": {
      "status": {
        "value": 0,
        "string": "completed without error",
        "passed": true
      },
      "polling_minutes": {
        "short": 2,
        "extended": 1489
      }
    },
    "capabilities": {
      "values": [
        91,
        3
      ],
      "exec_offline_immediate_supported": true,
      "offline_is_aborted_upon_new_cmd": false,
      "offline_surface_scan_supported": true,
      "self_tests_supported": true,
      "conveyance_self_test_supported": false,
      "selective_self_test_supported": true,
      "attribute_autosave_enabled": true,
      "error_logging_supported": true,
      "gp_logging_supported": true
    }
  },
  "ata_sct_capabilities": {
    "value": 61,
    "error_recovery_control_supported": true,
    "feature_control_supported": true,
    "data_table_supported": true
  },
  "ata_smart_attributes": {
    "revision": 16,
    "table": [
      {
        "id": 1,
        "name": "Raw_Read_Error_Rate",
        "value": 100,
        "worst": 100,
        "thresh": 1,
        "when_failed": "",
        "flags": {
          "value": 11,
          "string": "PO-R-- ",
          "prefailure": true,
          "updated_online": true,
          "performance": false,
          "error_rate": true,
          "event_count": false,
          "auto_keep": false
        },
        "raw": {
          "value": 0,
          "string": "0"
        }
      },
      {
        "id": 2,
        "name": "Throughput_Performance",
        "value": 135,
        "worst": 135,
        "thresh": 54,
        "when_failed": "",
        "flags": {
          "value": 4,
          "string": "--S--- ",
          "prefailure": false,
          "updated_online": false,
          "performance": true,
          "error_rate": false,
          "event_count": false,
          "auto_keep": false
        },
        "raw": {
          "value": 104,
          "string": "104"
        }
      },
      {
        "id": 3,
        "name": "Spin_Up_Time",
        "value": 81,
        "worst": 81,
        "thresh": 1,
        "when_failed": "",
        "flags": {
          "value": 7,
          "string": "POS--- ",
          "prefailure": true,
          "updated_online": true,
          "performance": true,
          "error_rate": false,
          "event_count": false,
          "auto_keep": false
        },
        "raw": {
          "value": 30089478521,
          "string": "377 (Average 377)"
        }
      },
      {
        "id": 4,
        "name": "Start_Stop_Count",
        "value": 100,
        "worst": 100,
        "thresh": 0,
        "when_failed": "",
        "flags": {
          "value": 18,
          "string": "-O--C- ",
          "prefailure": false,
          "updated_online": true,
          "performance": false,
          "error_rate": false,
          "event_count": true,
          "auto_keep": false
        },
        "raw": {
          "value": 9,
          "string": "9"
        }
      },
      {
        "id": 5,
        "name": "Reallocated_Sector_Ct",
        "value": 100,
        "worst": 100,
        "thresh": 1,
        "when_failed": "",
        "flags": {
          "value": 51,
          "string": "PO--CK ",
          "prefailure": true,
          "updated_online": true,
          "performance": false,
          "error_rate": false,
          "event_count": true,
          "auto_keep": true
        },
        "raw": {
          "value": 0,
          "string": "0"
        }
      },
      {
        "id": 7,
        "name": "Seek_Error_Rate",
        "value": 100,
        "worst": 100,
        "thresh": 1,
        "when_failed": "",
        "flags": {
          "value": 10,
          "string": "-O-R-- ",
          "prefailure": false,
          "updated_online": true,
          "performance": false,
          "error_rate": true,
          "event_count": false,
          "auto_keep": false
        },
        "raw": {
          "value": 0,
          "string": "0"
        }
      },
      {
        "id": 8,
        "name": "Seek_Time_Performance",
        "value": 133,
        "worst": 133,
        "thresh": 20,
        "when_failed": "",
        "flags": {
          "value": 4,
          "string": "--S--- ",
          "prefailure": false,
          "updated_online": false,
          "performance": true,
          "error_rate": false,
          "event_count": false,
          "auto_keep": false
        },
        "raw": {
          "value": 18,
          "string": "18"
        }
      },
      {
        "id": 9,
        "name": "Power_On_Hours",
        "value": 100,
        "worst": 100,
        "thresh": 0,
        "when_failed": "",
        "flags": {
          "value": 18,
          "string": "-O--C- ",
          "prefailure": false,
          "updated_online": true,
          "performance": false,
          "error_rate": false,
          "event_count": true,
          "auto_keep": false
        },
        "raw": {
          "value": 2681,
          "string": "2681"
        }
      },
      {
        "id": 10,
        "name": "Spin_Retry_Count",
        "value": 100,
        "worst": 100,
        "thresh": 1,
        "when_failed": "",
        "flags": {
          "value": 18,
          "string": "-O--C- ",
          "prefailure": false,
          "updated_online": true,
          "performance": false,
          "error_rate": false,
          "event_count": true,
          "auto_keep": false
        },
        "raw": {
          "value": 0,
          "string": "0"
        }
      },
      {
        "id": 12,
        "name": "Power_Cycle_Count",
        "value": 100,
        "worst": 100,
        "thresh": 0,
        "when_failed": "",
        "flags": {
          "value": 50,
          "string": "-O--CK ",
          "prefailure": false,
          "updated_online": true,
          "performance": false,
          "error_rate": false,
          "event_count": true,
          "auto_keep": true
        },
        "raw": {
          "value": 9,
          "string": "9"
        }
      },
      {
        "id": 22,
        "name": "Unknown_Attribute",
        "value": 100,
        "worst": 100,
        "thresh": 25,
        "when_failed": "",
        "flags": {
          "value": 35,
          "string": "PO---K ",
          "prefailure": true,
          "updated_online": true,
          "performance": false,
          "error_rate": false,
          "event_count": false,
          "auto_keep": true
        },
        "raw": {
          "value": 100,
          "string": "100"
        }
      },
      {
        "id": 192,
        "name": "Power-Off_Retract_Count",
        "value": 100,
        "worst": 100,
        "thresh": 0,
        "when_failed": "",
        "flags": {
          "value": 50,
          "string": "-O--CK ",
          "prefailure": false,
          "updated_online": true,
          "performance": false,
          "error_rate": false,
          "event_count": true,
          "auto_keep": true
        },
        "raw": {
          "value": 2472,
          "string": "2472"
        }
      },
      {
        "id": 193,
        "name": "Load_Cycle_Count",
        "value": 100,
        "worst": 100,
        "thresh": 0,
        "when_failed": "",
        "flags": {
          "value": 18,
          "string": "-O--C- ",
          "prefailure": false,
          "updated_online": true,
          "performance": false,
          "error_rate": false,
          "event_count": true,
          "auto_keep": false
        },
        "raw": {
          "value": 2472,
          "string": "2472"
        }
      },
      {
        "id": 194,
        "name": "Temperature_Celsius",
        "value": 57,
        "worst": 57,
        "thresh": 0,
        "when_failed": "",
        "flags": {
          "value": 2,
          "string": "-O---- ",
          "prefailure": false,
          "updated_online": true,
          "performance": false,
          "error_rate": false,
          "event_count": false,
          "auto_keep": false
        },
        "raw": {
          "value": 158915231772,
          "string": "28 (Min/Max 22/37)"
        }
      },
      {
        "id": 196,
        "name": "Reallocated_Event_Count",
        "value": 100,
        "worst": 100,
        "thresh": 0,
        "when_failed": "",
        "flags": {
          "value": 50,
          "string": "-O--CK ",
          "prefailure": false,
          "updated_online": true,
          "performance": false,
          "error_rate": false,
          "event_count": true,
          "auto_keep": true
        },
        "raw": {
          "value": 0,
          "string": "0"
        }
      },
      {
        "id": 197,
        "name": "Current_Pending_Sector",
        "value": 100,
        "worst": 100,
        "thresh": 0,
        "when_failed": "",
        "flags": {
          "value": 34,
          "string": "-O---K ",
          "prefailure": false,
          "updated_online": true,
          "performance": false,
          "error_rate": false,
          "event_count": false,
          "auto_keep": true
        },
        "raw": {
          "value": 0,
          "string": "0"
        }
      },
      {
        "id": 198,
        "name": "Offline_Uncorrectable",
        "value": 100,
        "worst": 100,
        "thresh": 0,
        "when_failed": "",
        "flags": {
          "value": 8,
          "string": "---R-- ",
          "prefailure": false,
          "updated_online": false,
          "performance": false,
          "error_rate": true,
          "event_count": false,
          "auto_keep": false
        },
        "raw": {
          "value": 0,
          "string": "0"
        }
      },
      {
        "id": 199,
        "name": "UDMA_CRC_Error_Count",
        "value": 100,
        "worst": 100,
        "thresh": 0,
        "when_failed": "",
        "flags": {
          "value": 10,
          "string": "-O-R-- ",
          "prefailure": false,
          "updated_online": true,
          "performance": false,
          "error_rate": true,
          "event_count": false,
          "auto_keep": false
        },
        "raw": {
          "value": 0,
          "string": "0"
        }
      }
    ]
  },
  "power_on_time": {
    "hours": 2681
  },
  "power_cycle_count": 9,
  "temperature": {
    "current": 28
  },
  "ata_smart_error_log": {
    "summary": {
      "revision": 1,
      "count": 0
    }
  },
  "ata_smart_self_test_log": {
    "standard": {
      "revision": 1,
      "table": [
        {
          "type": {
            "value": 2,
            "string": "Extended offline"
          },
          "status": {
            "value": 0,
            "string": "Completed without error",
            "passed": true
          },
          "lifetime_hours": 1911
        },
        {
          "type": {
            "value": 1,
            "string": "Short offline"
          },
          "status": {
            "value": 0,
            "string": "Completed without error",
            "passed": true
          },
          "lifetime_hours": 1877
        },
        {
          "type": {
            "value": 1,
            "string": "Short offline"
          },
          "status": {
            "value": 0,
            "string": "Completed without error",
            "passed": true
          },
          "lifetime_hours": 1853
        },
        {
          "type": {
            "value": 1,
            "string": "Short offline"
          },
          "status": {
            "value": 0,
            "string": "Completed without error",
            "passed": true
          },
          "lifetime_hours": 1804
        },
        {
          "type": {
            "value": 1,
            "string": "Short offline"
          },
          "status": {
            "value": 0,
            "string": "Completed without error",
            "passed": true
          },
          "lifetime_hours": 1780
        },
        {
          "type": {
            "value": 2,
            "string": "Extended offline"
          },
          "status": {
            "value": 0,
            "string": "Completed without error",
            "passed": true
          },
          "lifetime_hours": 1760
        },
        {
          "type": {
            "value": 1,
            "string": "Short offline"
          },
          "status": {
            "value": 0,
            "string": "Completed without error",
            "passed": true
          },
          "lifetime_hours": 1708
        },
        {
          "type": {
            "value": 1,
            "string": "Short offline"
          },
          "status": {
            "value": 0,
            "string": "Completed without error",
            "passed": true
          },
          "lifetime_hours": 1684
        },
        {
          "type": {
            "value": 1,
            "string": "Short offline"
          },
          "status": {
            "value": 0,
            "string": "Completed without error",
            "passed": true
          },
          "lifetime_hours": 1661
        },
        {
          "type": {
            "value": 1,
            "string": "Short offline"
          },
          "status": {
            "value": 0,
            "string": "Completed without error",
            "passed": true
          },
          "lifetime_hours": 1636
        },
        {
          "type": {
            "value": 1,
            "string": "Short offline"
          },
          "status": {
            "value": 0,
            "string": "Completed without error",
            "passed": true
          },
          "lifetime_hours": 1613
        },
        {
          "type": {
            "value": 1,
            "string": "Short offline"
          },
          "status": {
            "value": 0,
            "string": "Completed without error",
            "passed": true
          },
          "lifetime_hours": 1589
        },
        {
          "type": {
            "value": 2,
            "string": "Extended offline"
          },
          "status": {
            "value": 0,
            "string": "Completed without error",
            "passed": true
          },
          "lifetime_hours": 1588
        },
        {
          "type": {
            "value": 1,
            "string": "Short offline"
          },
          "status": {
            "value": 0,
            "string": "Completed without error",
            "passed": true
          },
          "lifetime_hours": 1541
        },
        {
          "type": {
            "value": 1,
            "string": "Short offline"
          },
          "status": {
            "value": 0,
            "string": "Completed without error",
            "passed": true
          },
          "lifetime_hours": 1517
        },
        {
          "type": {
            "value": 1,
            "string": "Short offline"
          },
          "status": {
            "value": 0,
            "string": "Completed without error",
            "passed": true
          },
          "lifetime_hours": 1493
        },
        {
          "type": {
            "value": 1,
            "string": "Short offline"
          },
          "status": {
            "value": 0,
            "string": "Completed without error",
            "passed": true
          },
          "lifetime_hours": 1469
        },
        {
          "type": {
            "value": 1,
            "string": "Short offline"
          },
          "status": {
            "value": 0,
            "string": "Completed without error",
            "passed": true
          },
          "lifetime_hours": 1445
        },
        {
          "type": {
            "value": 2,
            "string": "Extended offline"
          },
          "status": {
            "value": 0,
            "string": "Completed without error",
            "passed": true
          },
          "lifetime_hours": 1430
        },
        {
          "type": {
            "value": 1,
            "string": "Short offline"
          },
          "status": {
            "value": 0,
            "string": "Completed without error",
            "passed": true
          },
          "lifetime_hours": 1373
        },
        {
          "type": {
            "value": 1,
            "string": "Short offline"
          },
          "status": {
            "value": 0,
            "string": "Completed without error",
            "passed": true
          },
          "lifetime_hours": 1349
        }
      ],
      "count": 21,
      "error_count_total": 0,
      "error_count_outdated": 0
    }
  },
  "ata_smart_selective_self_test_log": {
    "revision": 1,
    "table": [
      {
        "lba_min": 0,
        "lba_max": 0,
        "status": {
          "value": 0,
          "string": "Not_testing"
        }
      },
      {
        "lba_min": 0,
        "lba_max": 0,
        "status": {
          "value": 0,
          "string": "Not_testing"
        }
      },
      {
        "lba_min": 0,
        "lba_max": 0,
        "status": {
          "value": 0,
          "string": "Not_testing"
        }
      },
      {
        "lba_min": 0,
        "lba_max": 0,
        "status": {
          "value": 0,
          "string": "Not_testing"
        }
      },
      {
        "lba_min": 0,
        "lba_max": 0,
        "status": {
          "value": 0,
          "string": "Not_testing"
        }
      }
    ],
    "flags": {
      "value": 0,
      "remainder_scan_enabled": false
    },
    "power_up_scan_resume_minutes": 0
  }
}

Webhooks & notification system

  • custom scripts
  • webhooks
  • 3rd party services (discord/slack/pushbullet/pushover/etc)
  • filter/disable notifications per drive.

[FEAT] Change attribute row UI to make source of value, worst, threshold & failure values clear

I was cruising through the Drive Details and was surprised about Spin-Up Time showing Value=177 and Worst=172.
I was surprised that there could be a spin-up time value higher than the worst since in my opinion for spin-up time smaller is better.

I see two possible improvements for that:

  1. Have different logic sets for different SMART attributes, so you could define that for spin-up time smaller is better while for others it may differ.

  2. Change the column header from the opinionated word Worst to something unopinionated e.g. Maximum or Highest.

Screenshot_2020-09-25 scrutiny

By the way. Great work! Thx for all.

Collection failure when connected devices are across separate buses

When running the collector, any device not connected to the first bus scanned fails to load. For reference, here's what the UI shows:
Scrutiny_display

There are several options here, the easiest of which would be something like 'if <smartcl -a> returns error, then <smartcl -x> AND <smartctl -l selftest /dev/sdBLAH>, end if / else end' - I've confirmed that these devices show their data properly in this case.

Take, for example:

smartctl -a /dev/sdz
smartctl 7.1 2019-12-30 r5022 [x86_64-linux-4.19.107-Unraid] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Vendor:               IBM-ESXS
Product:              ST3000NM0043  E
Revision:             EC5L
Compliance:           SPC-4
User Capacity:        3,000,592,982,016 bytes [3.00 TB]
Logical block size:   512 bytes
LU is fully provisioned
Rotation Rate:        7200 rpm
Form Factor:          3.5 inches
Logical Unit id:      0x5000c50083ef0e8f
Serial number:        Z1Y3HGGZ0000R553JSTG
Device type:          disk
Transport protocol:   SAS (SPL-3)
Local Time is:        Sun Sep 20 13:04:25 2020 CDT
SMART support is:     Available - device has SMART capability.
SMART support is:     Enabled
Temperature Warning:  Enabled

=== START OF READ SMART DATA SECTION ===
SMART Health Status: OK

Current Drive Temperature:     38 C
Drive Trip Temperature:        65 C

Additionally, I can kick off a smart test as well:

smartctl -t short /dev/sdz
smartctl 7.1 2019-12-30 r5022 [x86_64-linux-4.19.107-Unraid] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org

Short Background Self Test has begun
Use smartctl -X to abort test

The drives still have smart, it just has to be queried explicitly (when connected through an add-in device which supports it):

smartctl -l selftest /dev/sdz
smartctl 7.1 2019-12-30 r5022 [x86_64-linux-4.19.107-Unraid] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF READ SMART DATA SECTION ===
SMART Self-test log
Num  Test              Status                 segment  LifeTime  LBA_first_err [SK ASC ASQ]
     Description                              number   (hours)
# 1  Background short  Completed                   -   31426                 - [-   -    -]
# 2  Background long   Completed                   -   31250                 - [-   -    -]

While it may not provide you the level of detail, I'm sure other options exist to query them (likely using sdparm... it's just been so long since I've messed with it that I can't remember it all currently, sorry!)

At the very least, this will give you the number of hours for the drive as well as it's SMART status, which while not perfect, is a great start.

Use `smartctl --scan` for device detection rather than `jaypipes/ghw`

If we use smartctl --scan we get the following benefits:

  • multi-platform, smartctl runs on windows, mac and linux
  • consistent output

Issues:

  • WWN is provided as component data, rather than a "string". We'll have to generate the WWN value ourselves
  • WWN from smartctl only provided for ATA protocol drives, NVMe and SCSI drives do not include WWN.
  • Manufacturer is not provided by smartctl
  • need to find alternative key for InterfaceType in smartctl data.
  • filtering logic must be done after scan ( ignoring removable disk, floppy, virtual storage controllers)
  • --scan does not return any results on mac

Automated Build/Release pipeline

  • Build docker images
    • AIO - all-in-one image with collector(s) and webapp/api
    • API
    • collector
  • Build manual install packages
    • build collector binary
    • build webapp/api binary, build frontend dist package.

NVMe drives not correctly detected by Scrutiny

Output of

root@c43726ce532e:/scrutiny# smartctl -j -x /dev/nvme0
{
  "json_format_version": [
    1,
    0
  ],
  "smartctl": {
    "version": [
      7,
      0
    ],
    "svn_revision": "4883",
    "platform_info": "x86_64-linux-4.19.107-Unraid",
    "build_info": "(local build)",
    "argv": [
      "smartctl",
      "-j",
      "-x",
      "/dev/nvme0"
    ],
    "exit_status": 0
  },
  "device": {
    "name": "/dev/nvme0",
    "info_name": "/dev/nvme0",
    "type": "nvme",
    "protocol": "NVMe"
  },
  "model_name": "Force MP510",
  "serial_number": "yes",
  "firmware_version": "ECFM12.3",
  "nvme_pci_vendor": {
    "id": 6535,
    "subsystem_id": 6535
  },
  "nvme_ieee_oui_identifier": 6584743,
  "nvme_total_capacity": 480103981056,
  "nvme_unallocated_capacity": 0,
  "nvme_controller_id": 1,
  "nvme_number_of_namespaces": 1,
  "nvme_namespaces": [
    {
      "id": 1,
      "size": {
        "blocks": 937703088,
        "bytes": 480103981056
      },
      "capacity": {
        "blocks": 937703088,
        "bytes": 480103981056
      },
      "utilization": {
        "blocks": 937703088,
        "bytes": 480103981056
      },
      "formatted_lba_size": 512,
      "eui64": {
        "oui": 6584743,
        "ext_id": 171819811633
      }
    }
  ],
  "user_capacity": {
    "blocks": 937703088,
    "bytes": 480103981056
  },
  "logical_block_size": 512,
  "local_time": {
    "time_t": 1600380529,
    "asctime": "Thu Sep 17 22:08:49 2020 Europe"
  },
  "smart_status": {
    "passed": true,
    "nvme": {
      "value": 0
    }
  },
  "nvme_smart_health_information_log": {
    "critical_warning": 0,
    "temperature": 38,
    "available_spare": 100,
    "available_spare_threshold": 5,
    "percentage_used": 1,
    "data_units_read": 6734413,
    "data_units_written": 15749028,
    "host_reads": 29048027,
    "host_writes": 17155968,
    "controller_busy_time": 298,
    "power_cycles": 4,
    "power_on_hours": 6420,
    "unsafe_shutdowns": 4,
    "media_errors": 0,
    "num_err_log_entries": 8382,
    "warning_temp_time": 0,
    "critical_comp_time": 0
  },
  "temperature": {
    "current": 38
  },
  "power_cycle_count": 4,
  "power_on_time": {
    "hours": 6420
  }
}

[BUG] Seagate 8TB Ironwolf ST8000VN004-2M2101 no attributes displayed

Describe the bug
Seagate 8TB Ironwolf drives are detected, and are displayed correctly on the dashboard, but the Drive Details page shows "0 visible, 22 hidden" attributes. Clicking "show all attributes" does not reveal any attributes.

I am using the linuxserver docker stack. However the official docker also displays the same behaviour, and the logs below are collected using the official docker.

Expected behavior
SMART attributes should be displayed for Seagate Ironwolf 8TB drives

Screenshots
image

image

image

Log Files
If related to missing devices or SMART data, please run the collector in DEBUG mode, and attach the log file.

docker run -it --rm -p 8080:8080 \
-v /run/udev:/run/udev:ro \
--cap-add SYS_RAWIO \
--device=/dev/sda \
--device=/dev/sdb \
-e DEBUG=true \
-e COLLECTOR_LOG_FILE=/tmp/collector.log \
-e SCRUTINY_LOG_FILE=/tmp/web.log \
--name scrutiny \
analogj/scrutiny

# in another terminal trigger the collector
docker exec scrutiny scrutiny-collector-metrics run

# then use docker cp to copy the log files out of the container.
docker cp scrutiny:/tmp/collector.log collector.log
docker cp scrutiny:/tmp/web.log web.log

collector.log
web.log

Windows (Docker) support?

Plan for eventual windows support.

API

  • Scrutiny webapp binary released for windows

Collector

  • Smartctl works on windows
  • manually installed collector should work, (but additional device scan metadata will be broken)

Docker

Attempting to load dashboard from web container presents 404s

$ curl http://xxxxxx/
<a href="/web">Found</a>.

$ curl http://xxxxxxx/web
<a href="/web/">Moved Permanently</a>.

$ curl http://xxxxxx/web/
404 page not found

Logs simply show:

web_1        | [GIN] 2020/09/17 - 12:54:19 | 404 |     176.723?s |      xxx.xxx.xxx.xxx | GET      "/web/"

There are successful responses from /api routes, so the API is definitely up, the collector appears to run successfully.

Happy to help debug, but so far i'm stumped (realise this isn't the most helpful issue in the world in terms of detail).

[FEAT] Support setting/overriding config variables with docker environment variables

Is your feature request related to a problem? Please describe.
A nice feature implemented by other docker-friendly projects is to allow setting config values via docker environment variables. While certainly not mission-critical this can help keep things neater with all config in e.g. a docker-compose file

Describe the solution you'd like
E.g.

    environment:
      - SCRUTINY_NOTIFY_PUSHOVER=pushover://shoutrrr:apiToken@userKey/?devices=device1

Additional context
E.g. https://wiki.cajun.pro/books/varken/page/breakdown#bkmrk-environment-variable
Thanks for this awesome tool.

[BUG] Cannot override incorrect device type from smartctl --scan, breaks Synology

Hi, I'm trying scrutiny on a Synology NAS (using Docker) and I notice that it does not correctly gets smart details for the internal disks.

Running the collector, I see that its trying to query the disk using scsi by the results of "smartctl -a -j /dev/sdb":

  "device": {
    "name": "/dev/sdb",
    "info_name": "/dev/sdb",
    "type": "scsi",
    "protocol": "SCSI"
  },

However, in a synology, the query must be done in "sat" mode (SCSI to ATA Translation) ("scsi" does not return smart values and "ata" does not work).

Here are the ouputs of the three modes:

scsi results:

root@a26318c5f903:/scrutiny/bin# smartctl -d scsi --all /dev/sdb                                        
smartctl 7.0 2018-12-30 r4883 [x86_64-linux-3.10.105] (local build)                                     
Copyright (C) 2002-18, Bruce Allen, Christian Franke, www.smartmontools.org                             
                                                                                                        
=== START OF INFORMATION SECTION ===                                                                    
Vendor:               HGST                                                                              
Product:              HDN726040ALE614                                                                   
Revision:             APGN                                                                              
Compliance:           SPC-3                                                                             
User Capacity:        4,000,787,030,016 bytes [4.00 TB]                                                 
Logical block size:   512 bytes                                                                         
Physical block size:  4096 bytes                                                                        
LU is fully provisioned                                                                                 
Rotation Rate:        7200 rpm                                                                          
Form Factor:          3.5 inches                                                                        
Logical Unit id:      0x5000cca25def1764                                                                
Serial number:        K4KXXXXX                                                                          
Device type:          disk                                                                              
Local Time is:        Mon Sep 28 21:00:47 2020 UTC                                                      
SMART support is:     Unavailable - device lacks SMART capability.                                      
                                                                                                        
=== START OF READ SMART DATA SECTION ===                                                                
Current Drive Temperature:     0 C                                                                      
Drive Trip Temperature:        0 C                                                                      
                                                                                                        
Error Counter logging not supported                                                                     
                                                                                                        
                                                                                                        
[GLTSD (Global Logging Target Save Disable) set. Enable Save with '-S on']                              
Device does not support Self Test logging    

ata results:

root@a26318c5f903:/scrutiny/bin# smartctl -d ata --all /dev/sdb                                         
smartctl 7.0 2018-12-30 r4883 [x86_64-linux-3.10.105] (local build)                                     
Copyright (C) 2002-18, Bruce Allen, Christian Franke, www.smartmontools.org                             
                                                                                                        
Read Device Identity failed: Permission denied                                                          
                                                                                                        
A mandatory SMART command failed: exiting. To continue, add one or more '-T permissive' options.       

sat results:

root@a26318c5f903:/scrutiny/bin# smartctl -d sat --all /dev/sdb                                         
smartctl 7.0 2018-12-30 r4883 [x86_64-linux-3.10.105] (local build)                                     
Copyright (C) 2002-18, Bruce Allen, Christian Franke, www.smartmontools.org                             
                                                                                                        
=== START OF INFORMATION SECTION ===                                                                    
Model Family:     HGST Deskstar NAS                                                                     
Device Model:     HGST HDN726040ALE614                                                                  
Serial Number:    K4KXXXXX                                                                              
LU WWN Device Id: 5 000cca 25def1764                                                                    
Firmware Version: APGNW7JH                                                                              
User Capacity:    4,000,787,030,016 bytes [4.00 TB]                                                     
Sector Sizes:     512 bytes logical, 4096 bytes physical                                                
Rotation Rate:    7200 rpm                                                                              
Form Factor:      3.5 inches                                                                            
Device is:        In smartctl database [for details use: -P show]                                       
ATA Version is:   ACS-2, ATA8-ACS T13/1699-D revision 4                                                 
SATA Version is:  SATA 3.1, 6.0 Gb/s (current: 3.0 Gb/s)                                                
Local Time is:    Mon Sep 28 20:57:22 2020 UTC                                                          
SMART support is: Available - device has SMART capability.                                              
SMART support is: Enabled                                                                               
                                                                                                        
=== START OF READ SMART DATA SECTION ===                                                                
SMART overall-health self-assessment test result: PASSED              

                                                                                                        
General SMART Values:                                                                                   
Offline data collection status:  (0x82) Offline data collection activity                                
                                        was completed without error.                                    
                                        Auto Offline Data Collection: Enabled.                          
Self-test execution status:      193 Load_Cycle_Count        0x0012   100   100   000    Old_age   Alway
s       -       1072                                                                                    
 12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       38               
192 Power-Off_Retract_Count 0x0032   100   100   000    Old_age   Always       -       1072             
(   0)  The previous self-test routine completed                                                        
                                        without error or no self-test has ever                          
                                        been run.                                                       
Total time to complete Offline                                                                          
data collection:                (  113) seconds.                                                        
Offline data collection                                                                                 
capabilities:                    (0x5b) SMART execute Offline immediate.                                
                                        Auto Offline data collection on/off support.                    
                                        Suspend Offline collection upon new                             
                                        command.                                                        
                                        Offline surface scan supported.                                 
                                        Self-test supported.                                            
                                        No Conveyance Self-test supported.                              
                                        Selective Self-test supported.                                  
SMART capabilities:            (0x0003) Saves SMART data before entering                                
                                        power-saving mode.                                              
                                        Supports SMART auto save timer.                                 
Error logging capability:        (0x01) Error logging supported.                                        
                                        General Purpose Logging supported.                              
Short self-test routine                                                                                 
recommended polling time:        (   2) minutes.                                                        
Extended self-test routine                                                                              
recommended polling time:        ( 571) minutes.                                                        
SCT capabilities:              (0x003d) SCT Status supported.                                           
                                        SCT Error Recovery Control supported.                           
                                        SCT Feature Control supported.                                  
                                        SCT Data Table supported.                                       
                                                              
SMART Attributes Data Structure revision number: 16                                                     
Vendor Specific SMART Attributes with Thresholds:                                                       
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE        
  1 Raw_Read_Error_Rate     0x000b   100   100   016    Pre-fail  Always       -       0                
  2 Throughput_Performance  0x0005   138   138   054    Pre-fail  Offline      -       100              
  3 Spin_Up_Time            0x0007   149   149   024    Pre-fail  Always       -       361 (Average 357)
  4 Start_Stop_Count        0x0012   100   100   000    Old_age   Always       -       50               
  5 Reallocated_Sector_Ct   0x0033   100   100   005    Pre-fail  Always       -       0                
  7 Seek_Error_Rate         0x000b   100   100   067    Pre-fail  Always       -       0                
  8 Seek_Time_Performance   0x0005   128   128   020    Pre-fail  Offline      -       18               
  9 Power_On_Hours          0x0012   097   097   000    Old_age   Always       -       24956            
 10 Spin_Retry_Count        0x0013   100   100   060    Pre-fail  Always       -       0                
194 Temperature_Celsius     0x0002   162   162   000    Old_age   Always       -       37 (Min/Max 22/52
)                                                                                                       
196 Reallocated_Event_Count 0x0032   100   100   000    Old_age   Always       -       0                
197 Current_Pending_Sector  0x0022   100   100   000    Old_age   Always       -       0                
198 Offline_Uncorrectable   0x0008   100   100   000    Old_age   Offline      -       0                
199 UDMA_CRC_Error_Count    0x000a   200   200   000    Old_age   Always       -       0                
                                                                                                        
SMART Error Log Version: 1                                                                              
No Errors Logged                                                                                        
                              
SMART Self-test log structure revision number 1                                                         
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error         
# 1  Extended offline    Completed without error       00%     24307         -                          
# 2  Extended offline    Completed without error       00%     23563         -                          
# 3  Extended offline    Completed without error       00%     22820         -                          
# 4  Extended offline    Completed without error       00%     22098         -                          
# 5  Extended offline    Completed without error       00%     21354         -                          
# 6  Extended offline    Completed without error       00%     20636         -                          
# 7  Extended offline    Completed without error       00%     19894         -                          
# 8  Extended offline    Completed without error       00%     19195         -                          
# 9  Extended offline    Completed without error       00%     18453         -                          
#10  Extended offline    Completed without error       00%     17707         -                          
#11  Extended offline    Completed without error       00%     16987         -                          
#12  Extended offline    Completed without error       00%     16244         -                          
#13  Extended offline    Completed without error       00%     15523         -                          
#14  Extended offline    Completed without error       00%     14780         -                          
#15  Extended offline    Completed without error       00%     14036         -                          
#16  Extended offline    Completed without error       00%     13319         -                          
#17  Extended offline    Completed without error       00%     12576         -                          
#18  Extended offline    Completed without error       00%     11852         -                          
#19  Extended offline    Completed without error       00%     11113         -                          
#20  Extended offline    Completed without error       00%     10441         -                          
#21  Extended offline    Completed without error       00%      9698         -                          
                                                                                                        
SMART Selective self-test log data structure revision number 1                                          
 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS                                                            
    1        0        0  Not_testing                                                                    
    2        0        0  Not_testing                                                                    
    3        0        0  Not_testing                                                                    
    4        0        0  Not_testing                                                                    
    5        0        0  Not_testing                                                                    
Selective self-test flags (0x0):                                                                        
  After scanning selected spans, do NOT read-scan remainder of disk.                                    
If Selective self-test is pending on power-up, resume after 0 minute delay.                    

[BUG] Dell PERC 5/i virtual disk does not appear on dashboard

Describe the bug
I am a using a PERC 5/i RAID controller with a singular virtual disk. I have a hunch that the problem has to do with the disk ids starting at 4 instead of 0 like in issue #30. My virtual disk is device /dev/sdc.

sudo smartctl -j --scan (without sudo the RAID disks do not appear)

{
  "json_format_version": [
    1,
    0
  ],
  "smartctl": {
    "version": [
      7,
      1
    ],
    "svn_revision": "5022",
    "platform_info": "x86_64-linux-5.4.0-48-generic",
    "build_info": "(local build)",
    "argv": [
      "smartctl",
      "-j",
      "--scan"
    ],
    "exit_status": 0
  },
  "devices": [
    {
      "name": "/dev/sda",
      "info_name": "/dev/sda",
      "type": "scsi",
      "protocol": "SCSI"
    },
    {
      "name": "/dev/sdb",
      "info_name": "/dev/sdb",
      "type": "scsi",
      "protocol": "SCSI"
    },
    {
      "name": "/dev/sdc",
      "info_name": "/dev/sdc",
      "type": "scsi",
      "protocol": "SCSI"
    },
    {
      "name": "/dev/bus/4",
      "info_name": "/dev/bus/4 [megaraid_disk_04]",
      "type": "megaraid,4",
      "protocol": "SCSI"
    },
    {
      "name": "/dev/bus/4",
      "info_name": "/dev/bus/4 [megaraid_disk_05]",
      "type": "megaraid,5",
      "protocol": "SCSI"
    },
    {
      "name": "/dev/bus/4",
      "info_name": "/dev/bus/4 [megaraid_disk_06]",
      "type": "megaraid,6",
      "protocol": "SCSI"
    },
    {
      "name": "/dev/bus/4",
      "info_name": "/dev/bus/4 [megaraid_disk_07]",
      "type": "megaraid,7",
      "protocol": "SCSI"
    }
  ]
}

Expected behavior
If nothing else, the virtual drive appears on the dashboard. Ideally, all 4 connected drives would be on the dashboard.

Screenshots

scrutiny-missing-_dev_sdc

Log Files

collector.log

web.log

downsample algorithm

Outstanding Tasks

  • Fix tests (mock out the scrutiny repository and use it in tests)
  • Change queries so they query multiple buckets from InfluxDB.
  • Ensure that downsampled data still works in the UI and is correctly decoded.

Links to InfluxDB downsampling

[BUG] Some drive types do not display value for Power on Hours

Describe the bug
NVMe drives do not display value for Power on Hours

Screenshots
See #37 for more information + logs.

Log Files

time="2020-09-25T17:41:29Z" level=info msg="Executing command: smartctl -a -j /dev/sdi" type=metrics
{
  "json_format_version": [
    1,
    0
  ],
  "smartctl": {
    "version": [
      7,
      0
    ],
    "svn_revision": "4883",
    "platform_info": "x86_64-linux-4.19.107-Unraid",
    "build_info": "(local build)",
    "argv": [
      "smartctl",
      "-a",
      "-j",
      "/dev/sdi"
    ],
    "exit_status": 0
  },
  "device": {
    "name": "/dev/sdi",
    "info_name": "/dev/sdi",
    "type": "scsi",
    "protocol": "SCSI"
  },
  "vendor": "TOSHIBA",
  "product": "MG03SCA300",
  "model_name": "TOSHIBA MG03SCA300",
  "revision": "DG04",
  "scsi_version": "SPC-4",
  "user_capacity": {
    "blocks": 5860533168,
    "bytes": 3000592982016
  },
  "logical_block_size": 512,
  "rotation_rate": 7200,
  "form_factor": {
    "scsi_value": 2,
    "name": "3.5 inches"
  },
  "serial_number": "Z4K0AXXXXXX",
  "device_type": {
    "scsi_value": 0,
    "name": "disk"
  },
  "local_time": {
    "time_t": 1601055689,
    "asctime": "Fri Sep 25 17:41:29 2020 America"
  },
  "smart_status": {
    "passed": true
  },
  "temperature": {
    "current": 33,
    "drive_trip": 65
  },
  "scsi_grown_defect_list": 0,
  "scsi_error_counter_log": {
    "read": {
      "errors_corrected_by_eccfast": 0,
      "errors_corrected_by_eccdelayed": 9,
      "errors_corrected_by_rereads_rewrites": 9,
      "total_errors_corrected": 9,
      "correction_algorithm_invocations": 15,
      "gigabytes_processed": "5670384.023",
      "total_uncorrected_errors": 0
    },
    "write": {
      "errors_corrected_by_eccfast": 0,
      "errors_corrected_by_eccdelayed": 0,
      "errors_corrected_by_rereads_rewrites": 0,
      "total_errors_corrected": 0,
      "correction_algorithm_invocations": 0,
      "gigabytes_processed": "102090.851",
      "total_uncorrected_errors": 0
    },
    "verify": {
      "errors_corrected_by_eccfast": 0,
      "errors_corrected_by_eccdelayed": 1,
      "errors_corrected_by_rereads_rewrites": 1,
      "total_errors_corrected": 1,
      "correction_algorithm_invocations": 1,
      "gigabytes_processed": "669629.192",
      "total_uncorrected_errors": 0
    }
  }
}

[BUG]smartctl checksum errors

Hi,

i'm using the linuxserver.io docker image (latest tag) and currently am getting the following errors when running "scrutiny-collector-metrics run"

`root@abc9cc899866:/# scrutiny-collector-metrics run


/ ) / )( _ ( )( )( )( )( ( )( / )
_
( (
) / )(
)( )( )( ) ( \ /
(
/ _)()_)() () ()()_) (__)
AnalogJ/scrutiny/metrics dev-0.1.13

INFO[0000] Verifying required tools type=metrics
INFO[0000] Sending detected devices to API, for filtering & validation type=metrics
INFO[0000] Main: Waiting for workers to finish type=metrics
INFO[0000] Collecting smartctl results for sdd type=metrics
INFO[0000] Collecting smartctl results for sda type=metrics
INFO[0000] Collecting smartctl results for sdb type=metrics
INFO[0000] Collecting smartctl results for sdc type=metrics
{
"json_format_version": [
1,
0
],
"smartctl": {
"version": [
7,
1
],
"svn_revision": "5022",
"platform_info": "x86_64-linux-4.14.24-qnap",
"build_info": "(local build)",
"argv": [
"smartctl",
"-a",
"-j",
"/dev/sda"
],
"exit_status": 4
},
"device": {
"name": "/dev/sda",
"info_name": "/dev/sda",
"type": "scsi",
"protocol": "SCSI"
},
"vendor": "WDC",
"product": "WD100EMAZ-00WJTA",
"model_name": "WDC WD100EMAZ-00WJTA",
"revision": "83.H",
"scsi_version": "SPC-3",
"user_capacity": {
"blocks": 19532873728,
"bytes": 10000831348736
},
"logical_block_size": 512,
"physical_block_size": 4096,
"rotation_rate": 5400,
"form_factor": {
"scsi_value": 2,
"name": "3.5 inches"
},
"serial_number": "2YJDN6SD",
"device_type": {
"scsi_value": 0,
"name": "disk"
},
"local_time": {
"time_t": 1601292556,
"asctime": "Mon Sep 28 20:29:16 2020 KST"
},
"temperature": {
"current": 0,
"drive_trip": 0
}
}
ERRO[0000] smartctl returned an error code (4) while processing sda type=metrics
ERRO[0000] smartctl detected a checksum error type=metrics
INFO[0000] Publishing smartctl results for unknown type=metrics
{
"json_format_version": [
1,
0
],
"smartctl": {
"version": [
7,
1
],
"svn_revision": "5022",
"platform_info": "x86_64-linux-4.14.24-qnap",
"build_info": "(local build)",
"argv": [
"smartctl",
"-a",
"-j",
"/dev/sdb"
],
"exit_status": 4
},
"device": {
"name": "/dev/sdb",
"info_name": "/dev/sdb",
"type": "scsi",
"protocol": "SCSI"
},
"vendor": "WDC",
"product": "WD100EMAZ-00WJTA",
"model_name": "WDC WD100EMAZ-00WJTA",
"revision": "83.H",
"scsi_version": "SPC-3",
"user_capacity": {
"blocks": 19532873728,
"bytes": 10000831348736
},
"logical_block_size": 512,
"physical_block_size": 4096,
"rotation_rate": 5400,
"form_factor": {
"scsi_value": 2,
"name": "3.5 inches"
},
"serial_number": "2YJ8S5BD",
"device_type": {
"scsi_value": 0,
"name": "disk"
},
"local_time": {
"time_t": 1601292556,
"asctime": "Mon Sep 28 20:29:16 2020 KST"
},
"temperature": {
"current": 0,
"drive_trip": 0
}
}
ERRO[0000] smartctl returned an error code (4) while processing sdb type=metrics
ERRO[0000] smartctl detected a checksum error type=metrics
INFO[0000] Publishing smartctl results for unknown type=metrics
{
"json_format_version": [
1,
0
],
"smartctl": {
"version": [
7,
1
],
"svn_revision": "5022",
"platform_info": "x86_64-linux-4.14.24-qnap",
"build_info": "(local build)",
"argv": [
"smartctl",
"-a",
"-j",
"/dev/sdd"
],
"exit_status": 4
},
"device": {
"name": "/dev/sdd",
"info_name": "/dev/sdd",
"type": "scsi",
"protocol": "SCSI"
},
"vendor": "WDC",
"product": "WD100EMAZ-00WJTA",
"model_name": "WDC WD100EMAZ-00WJTA",
"revision": "83.H",
"scsi_version": "SPC-3",
"user_capacity": {
"blocks": 19532873728,
"bytes": 10000831348736
},
"logical_block_size": 512,
"physical_block_size": 4096,
"rotation_rate": 5400,
"form_factor": {
"scsi_value": 2,
"name": "3.5 inches"
},
"serial_number": "2YJDUTKD",
"device_type": {
"scsi_value": 0,
"name": "disk"
},
"local_time": {
"time_t": 1601292556,
"asctime": "Mon Sep 28 20:29:16 2020 KST"
},
"temperature": {
"current": 0,
"drive_trip": 0
}
}
ERRO[0000] smartctl returned an error code (4) while processing sdd type=metrics
ERRO[0000] smartctl detected a checksum error type=metrics
INFO[0000] Publishing smartctl results for unknown type=metrics
{
"json_format_version": [
1,
0
],
"smartctl": {
"version": [
7,
1
],
"svn_revision": "5022",
"platform_info": "x86_64-linux-4.14.24-qnap",
"build_info": "(local build)",
"argv": [
"smartctl",
"-a",
"-j",
"/dev/sdc"
],
"exit_status": 4
},
"device": {
"name": "/dev/sdc",
"info_name": "/dev/sdc",
"type": "scsi",
"protocol": "SCSI"
},
"vendor": "WDC",
"product": "WD100EMAZ-00WJTA",
"model_name": "WDC WD100EMAZ-00WJTA",
"revision": "83.H",
"scsi_version": "SPC-3",
"user_capacity": {
"blocks": 19532873728,
"bytes": 10000831348736
},
"logical_block_size": 512,
"physical_block_size": 4096,
"rotation_rate": 5400,
"form_factor": {
"scsi_value": 2,
"name": "3.5 inches"
},
"serial_number": "JEHN4M1N",
"device_type": {
"scsi_value": 0,
"name": "disk"
},
"local_time": {
"time_t": 1601292556,
"asctime": "Mon Sep 28 20:29:16 2020 KST"
},
"temperature": {
"current": 0,
"drive_trip": 0
}
}
ERRO[0000] smartctl returned an error code (4) while processing sdc type=metrics
ERRO[0000] smartctl detected a checksum error type=metrics
INFO[0000] Publishing smartctl results for unknown type=metrics
INFO[0001] Main: Completed type=metrics
root@abc9cc899866:/# `

After running, I can only see /dev/sda in the web UI and it has no details (SMART reports as failed).

I'm running this on a QNAP TS453Be.

Thanks,

[BUG] Podman must run scrutiny with sudo

Describe the bug
When running using podman, scurtiny-collector-metrics gives error " smartctl returned an error code of 2 while processing sdx type-metrics, and no data is in webpage

Expected behavior
Expected is hdd smart data in webpage

Screenshots
If applicable, add screenshots to help explain your problem.

Log Files
If related to missing devices or SMART data, please run the collector in DEBUG mode, and attach the log file.

docker run -it --rm -p 8080:8080 \
-v /run/udev:/run/udev:ro \
--cap-add SYS_RAWIO \
--device=/dev/sda \
--device=/dev/sdb \
-e DEBUG=true \
-e COLLECTOR_LOG_FILE=/tmp/collector.log \
-e SCRUTINY_LOG_FILE=/tmp/web.log \
--name scrutiny \
analogj/scrutiny





# in another terminal trigger the collector
docker exec scrutiny scrutiny-collector-metrics run

# then use docker cp to copy the log files out of the container.
docker cp scrutiny:/tmp/collector.log collector.log
docker cp scrutiny:/tmp/web.log web.log

collector.log
scrutiny
smartctl-in-container-results.txt
web.log

[FEAT] Test notification

I just setup scrutiny and like it. I tried to setup a notification and hopefully have included the config into docker correctly. But since my HDDs all work well at the moment (and I don't want that to change), is there a way to provoke a notification? Maybe on the CLI? Just to test that it'll work when it really detects something is wrong. Thanks!

Collector endpoint should default to what's defined in the config file

When running the collector with no arguments, it assumes the API is at localhost:8080, which when not using the omnibus container, it's not.

It'd be great if this could default to the value from the config file, so it doesn't need to be overriden when calling it manually.

Value: "http://localhost:8080",

This would probably also remove the need for the environment special case in the background job:

https://github.com/AnalogJ/scrutiny/blob/master/rootfs/scrutiny/jobber/jobber.yaml#L22

Should `Power Cycle Count` mark as failed when number is low?

As per title. Smart stats show Power Cycle Count as 64 and yet this shows as a failure in scrutiny. Is this correct? load_cycle_count is 4589 and that's a little on the high side but only a few times a day and doesn't seem hugely unreasonable to me based on past (anecdotal) experience. You are correlating this against backblazes failure data I presume and that's how you're coming up with FAIL?

SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x000b   100   100   016    Pre-fail  Always       -       0
  2 Throughput_Performance  0x0005   134   134   054    Pre-fail  Offline      -       104
  3 Spin_Up_Time            0x0007   138   138   024    Pre-fail  Always       -       474 (Average 477)
  4 Start_Stop_Count        0x0012   100   100   000    Old_age   Always       -       75
  5 Reallocated_Sector_Ct   0x0033   100   100   005    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x000b   100   100   067    Pre-fail  Always       -       0
  8 Seek_Time_Performance   0x0005   128   128   020    Pre-fail  Offline      -       18
  9 Power_On_Hours          0x0012   098   098   000    Old_age   Always       -       15656
 10 Spin_Retry_Count        0x0013   100   100   060    Pre-fail  Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       64
 22 Unknown_Attribute       0x0023   100   100   025    Pre-fail  Always       -       100
192 Power-Off_Retract_Count 0x0032   097   097   000    Old_age   Always       -       4589
193 Load_Cycle_Count        0x0012   097   097   000    Old_age   Always       -       4589
194 Temperature_Celsius     0x0002   162   162   000    Old_age   Always       -       37 (Min/Max 19/42)
196 Reallocated_Event_Count 0x0032   100   100   000    Old_age   Always       -       0
197 Current_Pending_Sector  0x0022   100   100   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0008   100   100   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x000a   200   200   000    Old_age   Always       -       0

image

[FEAT] Regarding the manual installation/running

Coming from the Reddit post, I'm trying to run the binaries manually on my system without the use of docker.

When I try starting the web server it looks for a non-existent database. Do I need to create that manually or is there a command I am missing?

[parker@stealth ~]$ ./scrutiny-web-linux-amd64 start 
2020/09/28 17:02:02 No configuration file found at /scrutiny/config/scrutiny.yaml. Skipping

 ___   ___  ____  __  __  ____  ____  _  _  _  _
/ __) / __)(  _ \(  )(  )(_  _)(_  _)( \( )( \/ )
\__ \( (__  )   / )(__)(   )(   _)(_  )  (  \  /
(___/ \___)(_)\_)(______) (__) (____)(_)\_) (__)
github.com/AnalogJ/scrutiny                     linux.amd64-0.2.1

Start the scrutiny server
[GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production.
 - using env:   export GIN_MODE=release
 - using code:  gin.SetMode(gin.ReleaseMode)

Trying to connect to database stored: /scrutiny/config/scrutiny.db
panic: Failed to connect to database!

goroutine 1 [running]:
github.com/analogj/scrutiny/webapp/backend/pkg/web/middleware.DatabaseMiddleware(0xeac900, 0xc00033e058, 0xeb1d60, 0xc00038c9a0, 0xeadc80)
        /go/src/github.com/analogj/scrutiny/webapp/backend/pkg/web/middleware/sqlite3.go:18 +0x48c
github.com/analogj/scrutiny/webapp/backend/pkg/web.(*AppEngine).Setup(0xc00033b0b0, 0xeb1d60, 0xc00038c9a0, 0x0)
        /go/src/github.com/analogj/scrutiny/webapp/backend/pkg/web/server.go:23 +0xcf
github.com/analogj/scrutiny/webapp/backend/pkg/web.(*AppEngine).Start(0xc00033b0b0, 0x0, 0x0)
        /go/src/github.com/analogj/scrutiny/webapp/backend/pkg/web/server.go:80 +0x1cb
main.main.func2(0xc000344ec0, 0x4, 0x6)
        /go/src/github.com/analogj/scrutiny/webapp/backend/cmd/scrutiny/scrutiny.go:112 +0x198
github.com/urfave/cli/v2.(*Command).Run(0xc000369c20, 0xc000344d40, 0x0, 0x0)
        /go/pkg/mod/github.com/urfave/cli/[email protected]/command.go:164 +0x4b9
github.com/urfave/cli/v2.(*App).RunContext(0xc00039e000, 0xea04c0, 0xc0000a6010, 0xc00009e020, 0x2, 0x2, 0x0, 0x0)
        /go/pkg/mod/github.com/urfave/cli/[email protected]/app.go:306 +0x790
github.com/urfave/cli/v2.(*App).Run(...)
        /go/pkg/mod/github.com/urfave/cli/[email protected]/app.go:215
main.main()
        /go/src/github.com/analogj/scrutiny/webapp/backend/cmd/scrutiny/scrutiny.go:137 +0x703

SMART Self Tests

Short & Long self tests (and results) should be recorded & displayed in the UI.

Support MegaRAID controller

I have a PowerEdge T320, with a PERC H710 controller. When I try to collect smart data it fails with this message: "smartctl returned an error code (4) while processing sda"

smartctl has support for MegaRAID with the command: "smartctl -d megaraid,0 -i /dev/sda" for disk 0, "smartctl -d megaraid,1 -i /dev/sda" for disk 1, and so on.

Would be awesome if support for this could be added to Scrutiny :)

[FEAT] Allow option to pass device type so devices not found in scan can be included

First, I'd like to say that Scrutiny is such a great idea. Thank for you for creating this!!

Feature Request
It would be awesome if there was a way to pass the device type to Scrutiny so that it can collect details on drives that the smartctl utility can't identify on it's own (due to USB bridge identification limits, etc).

Context

I deployed this in Docker to a little home server I run, and mapped in 3 devices in the config file as such:

  - device=/dev/sda
  - device=/dev/sdb
  - device=/dev/sdc

When I opened the Scrutiny UI after doing a scan, only the first two internal drives were visible. The last (/dev/sdc) is an external USB drive. I poked around and saw that it can be problematic for smartctl to get the details for external drives. However, if I could find and pass the correct device type for the USB bridge, it might work.

I was able to identify the correct value to pass for my particular drive, which allowed the retrieval of SMART data from my external drive from terminal. If I could provide configuration detail that the device is of type sat, hopefully I'll be able to monitor that external drive as well with Scrutiny. Below are the outputs of various commands I ran as I tested my theory.

sudo smartctl --scan

/dev/sda -d scsi # /dev/sda, SCSI device
/dev/sdb -d scsi # /dev/sdb, SCSI device

sudo smartctl -i /dev/sdc

smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.4.0-42-generic] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org

/dev/sdc: Unknown USB bridge [0x04e8:0x6123 (0x202)]
Please specify device type with the -d option.

Use smartctl -h to get a usage summary

sudo smartctl -i /dev/sdc -d sat

smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.4.0-42-generic] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family:     Seagate Barracuda 7200.14 (AF)
Device Model:     ST2000DM001-1E6164
Serial Number:    W1E86G1H
LU WWN Device Id: 5 000c50 073eb6239
Firmware Version: SC48
User Capacity:    2,000,398,934,016 bytes [2.00 TB]
Sector Sizes:     512 bytes logical, 4096 bytes physical
Rotation Rate:    7200 rpm
Form Factor:      3.5 inches
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   ATA8-ACS T13/1699-D revision 4
SATA Version is:  SATA 3.0, 6.0 Gb/s (current: 3.0 Gb/s)
Local Time is:    Sun Sep 27 19:10:19 2020 CDT
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.