diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f8a484..aa12de1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,8 @@ Version 1.3.1 ============= - Added support for test polling_minutes. Requested in [#77](https://github.com/truenas/py-SMART/issues/77) and [#78](https://github.com/truenas/py-SMART/pull/78). Thanks @Gigahawk -- Minnor typo fixed in NvmeAttributes (issue [#81](https://github.com/truenas/py-SMART/issues/81)). Thanks @petersulyok +- Minnor typo fixed in NvmeAttributes (issue [#81](https://github.com/truenas/py-SMART/issues/81)). Thanks @petersulyok +- Minnor fix for JBOD devices (MR [#85](https://github.com/truenas/py-SMART/pull/85)). Thanks @jackeichen - Fixed __getstate__ method in Device class. (issue [#86](https://github.com/truenas/py-SMART/issues/86)). Thanks @f18m - **Breaking changes** - **smartctl.all**: diff --git a/pySMART/device.py b/pySMART/device.py index 29b2d44..5e182de 100644 --- a/pySMART/device.py +++ b/pySMART/device.py @@ -644,7 +644,7 @@ def _classify(self) -> str: '-l', 'sasphy', self.dev_reference]) - if returncode == 0 and 'SAS SSP' in raw[4]: + if returncode == 0 and len(raw) > 4 and 'SAS SSP' in raw[4]: fine_interface = 'sas' # Some older SAS devices do not support the SAS PHY log command. # For these, see if smartmontools reports a transport protocol. diff --git a/tests/dataset/singletests/megaraid_jbod_sas_hdd_0_issue_85/_-d_scsi_--all__dev_sdd b/tests/dataset/singletests/megaraid_jbod_sas_hdd_0_issue_85/_-d_scsi_--all__dev_sdd new file mode 100644 index 0000000..94661cd --- /dev/null +++ b/tests/dataset/singletests/megaraid_jbod_sas_hdd_0_issue_85/_-d_scsi_--all__dev_sdd @@ -0,0 +1,52 @@ +smartctl 7.1 2020-04-05 r5049 [x86_64-linux-4.18.0-372.9.1.el8.x86_64] (local build) +Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org + +=== START OF INFORMATION SECTION === +Vendor: XXXXXXXXXXX +Product: XXXXXXXXXXX +Revision: CA00 +Compliance: SPC-5 +User Capacity: 800,166,076,416 bytes [800 GB] +Logical block size: 512 bytes +Physical block size: 4096 bytes +LU is resource provisioned, LBPRZ=1 +Rotation Rate: Solid State Device +Form Factor: 2.5 inches +Logical Unit id: 0x50025380725029b0 +Serial number: XXXXXXXXXXXXXXXX +Device type: disk +Transport protocol: SAS (SPL-3) +Local Time is: Tue Apr 9 08:02:36 2024 EDT +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 + +Percentage used endurance indicator: 0% +Current Drive Temperature: 42 C +Drive Trip Temperature: 65 C + +Manufactured in week 07 of year 2022 +Accumulated start-stop cycles: 135 +Specified load-unload count over device lifetime: 0 +Accumulated load-unload cycles: 0 +Elements in grown defect list: 0 + +Error counter log: + Errors Corrected by Total Correction Gigabytes Total + ECC rereads/ errors algorithm processed uncorrected + fast | delayed rewrites corrected invocations [10^9 bytes] errors +read: 0 0 0 0 0 27805.729 0 +write: 0 0 0 0 0 9378.908 0 +verify: 0 0 0 0 0 0.016 0 + +Non-medium error count: 84893 + +SMART Self-test log +Num Test Status segment LifeTime LBA_first_err [SK ASC ASQ] + Description number (hours) +# 1 Background short Completed - 349 - [- - -] + +Long (extended) Self-test duration: 3600 seconds [60.0 minutes] diff --git a/tests/dataset/singletests/megaraid_jbod_sas_hdd_0_issue_85/_-d_scsi_-l_background__dev_sdd b/tests/dataset/singletests/megaraid_jbod_sas_hdd_0_issue_85/_-d_scsi_-l_background__dev_sdd new file mode 100644 index 0000000..ffd4c27 --- /dev/null +++ b/tests/dataset/singletests/megaraid_jbod_sas_hdd_0_issue_85/_-d_scsi_-l_background__dev_sdd @@ -0,0 +1,6 @@ +smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.4.0-73-generic] (local build) +Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org + +=== START OF READ SMART DATA SECTION === +Device does not support Background scan results logging + diff --git a/tests/dataset/singletests/megaraid_jbod_sas_hdd_0_issue_85/_-d_scsi_-l_sasphy__dev_sdd b/tests/dataset/singletests/megaraid_jbod_sas_hdd_0_issue_85/_-d_scsi_-l_sasphy__dev_sdd new file mode 100644 index 0000000..fba5783 --- /dev/null +++ b/tests/dataset/singletests/megaraid_jbod_sas_hdd_0_issue_85/_-d_scsi_-l_sasphy__dev_sdd @@ -0,0 +1,4 @@ +smartctl 7.1 2020-04-05 r5049 [x86_64-linux-4.18.0-372.9.1.el8.x86_64] (local build) +Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org + +=== START OF READ SMART DATA SECTION === diff --git a/tests/dataset/singletests/megaraid_jbod_sas_hdd_0_issue_85/_-d_test__dev_sdd b/tests/dataset/singletests/megaraid_jbod_sas_hdd_0_issue_85/_-d_test__dev_sdd new file mode 100644 index 0000000..711d576 --- /dev/null +++ b/tests/dataset/singletests/megaraid_jbod_sas_hdd_0_issue_85/_-d_test__dev_sdd @@ -0,0 +1,5 @@ +smartctl 7.2 2021-01-17 r5171 [x86_64-linux-5.13.4-200.fc34.x86_64] (local build) +Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org + +/dev/sdd: Device of type 'scsi' [scsi] detected +/dev/sdd: Device of type 'scsi' [scsi] opened diff --git a/tests/dataset/singletests/megaraid_jbod_sas_hdd_0_issue_85/device.json b/tests/dataset/singletests/megaraid_jbod_sas_hdd_0_issue_85/device.json new file mode 100644 index 0000000..bcf82f3 --- /dev/null +++ b/tests/dataset/singletests/megaraid_jbod_sas_hdd_0_issue_85/device.json @@ -0,0 +1,379 @@ +{ + "name": "/dev/sdd", + "values": { + "abridged": false, + "assessment": "PASS", + "attributes": [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + "capacity": "800 GB", + "dev_interface": "sas", + "dev_reference": "/dev/sdd", + "diagnostics": { + "Corrected_Reads": 0, + "Corrected_Verifies": 0, + "Corrected_Writes": 0, + "Life_Left": 100, + "Load_Cycle_Count": 0, + "Load_Cycle_Pct_Left": null, + "Load_Cycle_Spec": 0, + "Non_Medium_Errors": null, + "Power_On_Hours": null, + "Reads_GB": 27805.729, + "Reads_count": 58312840183, + "Reallocated_Sector_Ct": 0, + "Start_Stop_Cycles": 135, + "Start_Stop_Pct_Left": null, + "Start_Stop_Spec": null, + "Uncorrected_Reads": 0, + "Uncorrected_Verifies": 0, + "Uncorrected_Writes": 0, + "Verifies_GB": 0.016, + "Verifies_count": 33554, + "Writes_GB": 9378.908, + "Writes_count": 19668995670, + "_Reads_GB": 27805.729, + "_Reads_count": null, + "_Uncorrected_Reads": 0, + "_Uncorrected_Verifies": 0, + "_Uncorrected_Writes": 0, + "_Verifies_GB": 0.016, + "_Verifies_count": null, + "_Writes_GB": 9378.908, + "_Writes_count": null, + "_block_size": 512, + "block_size": 512 + }, + "diags": { + "Corrected_Reads": "0", + "Corrected_Verifies": "0", + "Corrected_Writes": "0", + "Life_Left": "100%", + "Load_Cycle_Count": "0", + "Load_Cycle_Pct_Left": "-", + "Load_Cycle_Spec": "0", + "Non-Medium_Errors": "-", + "Power_On_Hours": "-", + "Reads_GB": "27805.729", + "Reads_count": "58312840183", + "Reallocated_Sector_Ct": "0", + "Start_Stop_Cycles": "135", + "Start_Stop_Pct_Left": "-", + "Start_Stop_Spec": "-", + "Uncorrected_Reads": "0", + "Uncorrected_Verifies": "0", + "Uncorrected_Writes": "0", + "Verifies_GB": "0.016", + "Verifies_count": "33554", + "Writes_GB": "9378.908", + "Writes_count": "19668995670", + "block_size": "512" + }, + "family": null, + "firmware": "CA00", + "if_attributes": null, + "interface": "scsi", + "is_ssd": true, + "logical_sector_size": 512, + "messages": [], + "model": "XXXXXXXXXXX", + "name": "sdd", + "physical_sector_size": 4096, + "rotation_rate": null, + "sector_size": 512, + "serial": "XXXXXXXXXXXXXXXX", + "size": 800166076416, + "size_raw": "800 GB", + "smart_capable": true, + "smart_enabled": true, + "smartctl_interface": "scsi", + "temperature": 42, + "temperatures": {}, + "test_capabilities": { + "conveyance": false, + "long": true, + "offline": false, + "selective": false, + "short": true + }, + "test_polling_time": { + "conveyance": 20, + "long": 1000, + "short": 10 + }, + "tests": [ + { + "ASC": "-", + "ASCQ": "-", + "LBA": "-", + "_format": "scsi", + "code": null, + "hours": "349", + "nsid": null, + "num": 1, + "remain": null, + "sct": null, + "segment": "-", + "sense": "-", + "status": "Completed", + "type": "Background short" + } + ], + "vendor": "XXXXXXXXXXX" + } +} \ No newline at end of file