Feature #1345
openFeature #1344: Hardware/Inventarisierung: Masterplan
smartctl JSON
Added by Simon Rettberg about 4 years ago. Updated almost 3 years ago.
100%
Description
smartmontools beherrschen seit einiger Zeit JSON-Ausgabe.
Abzuklären ist, wann das bei den Distros angekommen ist, ob alles was wir einsetzen das kann (HPC, bwLehrpool), und ob man notfalls die neuste Version selber compiliert.
Außerdem ist es bei solchen Ausgabeformaten natürlich wünschenwert, dass die in Zukunft auch stabil bleiben. Was wurde da vorgesehen? Versionierung, cmdlin Option für gewünschte Version, ...?
Updated by Simon Rettberg about 4 years ago
Hier mal das bwLaptop:
$ sudo smartctl --json=v -a /dev/sda { "json_format_version": [ 1, 0 ], "smartctl": { "version": [ 7, 1 ], "svn_revision": "5022", "platform_info": "x86_64-linux-5.4.0-4-amd64", "build_info": "(local build)", "argv": [ "smartctl", "--json=v", "-a", "/dev/sda" ], "exit_status": 0 }, "device": { "name": "/dev/sda", "info_name": "/dev/sda [SAT]", "type": "sat", "protocol": "ATA" }, "model_family": "Samsung based SSDs", "model_name": "SAMSUNG MZ7TD128HAFV-000L1", "serial_number": "S14TNSAF160229", "wwn": { "naa": 5, "oui": 9528, "id": 21474836480 }, "ata_additional_product_id": "00000000", "firmware_version": "DXT05L0Q", "user_capacity": { "blocks": 250069680, "blocks_s": "250069680", "bytes": 128035676160, "bytes_s": "128035676160" }, "logical_block_size": 512, "physical_block_size": 512, "rotation_rate": 0, "in_smartctl_database": true, "ata_version": { "string": "ACS-2, ATA8-ACS T13/1699-D revision 4c", "major_value": 1020, "minor_value": 57 }, "sata_version": { "string": "SATA 3.1", "value": 127 }, "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": 1584620443, "asctime": "Thu Mar 19 13:20:43 2020 CET" }, "smart_status": { "passed": true }, "ata_smart_data": { "offline_data_collection": { "status": { "value": 0, "string": "was never started" }, "completion_seconds": 65476 }, "self_test": { "status": { "value": 0, "string": "completed without error", "passed": true }, "polling_minutes": { "short": 2, "extended": 30 } }, "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": 1, "table": [ { "id": 9, "name": "Power_On_Hours", "value": 99, "worst": 99, "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": 643, "string": "643" } }, { "id": 12, "name": "Power_Cycle_Count", "value": 99, "worst": 99, "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": 782, "string": "782" } }, { "id": 175, "name": "Program_Fail_Count_Chip", "value": 100, "worst": 100, "thresh": 10, "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": 176, "name": "Erase_Fail_Count_Chip", "value": 100, "worst": 100, "thresh": 10, "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": 177, "name": "Wear_Leveling_Count", "value": 97, "worst": 97, "thresh": 5, "when_failed": "", "flags": { "value": 19, "string": "PO--C- ", "prefailure": true, "updated_online": true, "performance": false, "error_rate": false, "event_count": true, "auto_keep": false }, "raw": { "value": 25, "string": "25" } }, { "id": 178, "name": "Used_Rsvd_Blk_Cnt_Chip", "value": 100, "worst": 100, "thresh": 10, "when_failed": "", "flags": { "value": 19, "string": "PO--C- ", "prefailure": true, "updated_online": true, "performance": false, "error_rate": false, "event_count": true, "auto_keep": false }, "raw": { "value": 0, "string": "0" } }, { "id": 179, "name": "Used_Rsvd_Blk_Cnt_Tot", "value": 100, "worst": 100, "thresh": 10, "when_failed": "", "flags": { "value": 19, "string": "PO--C- ", "prefailure": true, "updated_online": true, "performance": false, "error_rate": false, "event_count": true, "auto_keep": false }, "raw": { "value": 0, "string": "0" } }, { "id": 180, "name": "Unused_Rsvd_Blk_Cnt_Tot", "value": 100, "worst": 100, "thresh": 10, "when_failed": "", "flags": { "value": 19, "string": "PO--C- ", "prefailure": true, "updated_online": true, "performance": false, "error_rate": false, "event_count": true, "auto_keep": false }, "raw": { "value": 3120, "string": "3120" } }, { "id": 181, "name": "Program_Fail_Cnt_Total", "value": 100, "worst": 100, "thresh": 10, "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": 182, "name": "Erase_Fail_Count_Total", "value": 100, "worst": 100, "thresh": 10, "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": 183, "name": "Runtime_Bad_Block", "value": 100, "worst": 100, "thresh": 10, "when_failed": "", "flags": { "value": 19, "string": "PO--C- ", "prefailure": true, "updated_online": true, "performance": false, "error_rate": false, "event_count": true, "auto_keep": false }, "raw": { "value": 0, "string": "0" } }, { "id": 184, "name": "End-to-End_Error", "value": 100, "worst": 100, "thresh": 97, "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": 187, "name": "Uncorrectable_Error_Cnt", "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": 190, "name": "Airflow_Temperature_Cel", "value": 75, "worst": 58, "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": 25, "string": "25" } }, { "id": 195, "name": "ECC_Error_Rate", "value": 200, "worst": 200, "thresh": 0, "when_failed": "", "flags": { "value": 26, "string": "-O-RC- ", "prefailure": false, "updated_online": true, "performance": false, "error_rate": true, "event_count": true, "auto_keep": false }, "raw": { "value": 0, "string": "0" } }, { "id": 198, "name": "Offline_Uncorrectable", "value": 100, "worst": 100, "thresh": 0, "when_failed": "", "flags": { "value": 48, "string": "----CK ", "prefailure": false, "updated_online": false, "performance": false, "error_rate": false, "event_count": true, "auto_keep": true }, "raw": { "value": 0, "string": "0" } }, { "id": 199, "name": "CRC_Error_Count", "value": 253, "worst": 253, "thresh": 0, "when_failed": "", "flags": { "value": 62, "string": "-OSRCK ", "prefailure": false, "updated_online": true, "performance": true, "error_rate": true, "event_count": true, "auto_keep": true }, "raw": { "value": 0, "string": "0" } }, { "id": 233, "name": "Media_Wearout_Indicator", "value": 199, "worst": 199, "thresh": 0, "when_failed": "", "flags": { "value": 58, "string": "-O-RCK ", "prefailure": false, "updated_online": true, "performance": false, "error_rate": true, "event_count": true, "auto_keep": true }, "raw": { "value": 233703, "string": "233703" } }, { "id": 234, "name": "Unknown_Samsung_Attr", "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": 0, "string": "0" } }, { "id": 235, "name": "POR_Recovery_Count", "value": 99, "worst": 99, "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": 45, "string": "45" } }, { "id": 236, "name": "Unknown_Samsung_Attr", "value": 99, "worst": 99, "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": 14, "string": "14" } }, { "id": 237, "name": "Unknown_Samsung_Attr", "value": 99, "worst": 99, "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": 25, "string": "25" } }, { "id": 238, "name": "Unknown_Samsung_Attr", "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": 0, "string": "0" } } ] }, "power_on_time": { "hours": 643 }, "power_cycle_count": 782, "temperature": { "current": 25 }, "ata_smart_error_log": { "summary": { "revision": 1, "count": 0 } }, "ata_smart_self_test_log": { "standard": { "revision": 1, "count": 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" } } ], "current_read_scan": { "lba_min": 0, "lba_max": 65535, "status": { "value": 0, "string": "was never started" } }, "flags": { "value": 0, "remainder_scan_enabled": false }, "power_up_scan_resume_minutes": 0 } }
Gleiche Ausgabe für NVMe wär noch interessant.
Updated by Jannik Schönartz about 4 years ago
Ich habe das ganze mal für einen Rechner in der WM4 gemacht (zeft9003).
$ sudo smartctl --json=v -a /dev/nvme0
{
"json_format_version": [
1,
0
],
"smartctl": {
"version": [
7,
1
],
"svn_revision": "5022",
"platform_info": "x86_64-linux-4.19.89-openslx+",
"build_info": "(local build)",
"argv": [
"smartctl",
"--json=v",
"-a",
"/dev/nvme0"
],
"uint128_precision_bits": 128,
"exit_status": 0
},
"device": {
"name": "/dev/nvme0",
"info_name": "/dev/nvme0",
"type": "nvme",
"protocol": "NVMe"
},
"model_name": "SAMSUNG MZVLB256HAHQ-00000",
"serial_number": "S444NA0M304321",
"firmware_version": "EXD7201Q",
"nvme_pci_vendor": {
"id": 5197,
"subsystem_id": 5197
},
"nvme_ieee_oui_identifier": 9528,
"nvme_total_capacity": 256060514304,
"nvme_total_capacity_s": "256060514304",
"nvme_total_capacity_le": [
0,
96,
101,
158,
59
],
"nvme_unallocated_capacity": 0,
"nvme_unallocated_capacity_s": "0",
"nvme_controller_id": 4,
"nvme_number_of_namespaces": 1,
"nvme_namespaces": [
{
"id": 1,
"size": {
"blocks": 500118192,
"blocks_s": "500118192",
"bytes": 256060514304,
"bytes_s": "256060514304",
"bytes_le": [
0,
96,
101,
158,
59
]
},
"capacity": {
"blocks": 500118192,
"blocks_s": "500118192",
"bytes": 256060514304,
"bytes_s": "256060514304",
"bytes_le": [
0,
96,
101,
158,
59
]
},
"utilization": {
"blocks": 93325760,
"blocks_s": "93325760",
"bytes": 47782789120,
"bytes_s": "47782789120",
"bytes_le": [
0,
128,
19,
32,
11
]
},
"formatted_lba_size": 512,
"eui64": {
"oui": 9528,
"ext_id": 565073572353
}
}
],
"user_capacity": {
"blocks": 500118192,
"blocks_s": "500118192",
"bytes": 256060514304,
"bytes_s": "256060514304",
"bytes_le": [
0,
96,
101,
158,
59
]
},
"logical_block_size": 512,
"local_time": {
"time_t": 1584910049,
"asctime": "Sun Mar 22 21:47:29 2020 CET"
},
"smart_status": {
"passed": true,
"nvme": {
"value": 0
}
},
"nvme_smart_health_information_log": {
"critical_warning": 0,
"temperature": 32,
"available_spare": 100,
"available_spare_threshold": 10,
"percentage_used": 0,
"data_units_read": 62583,
"data_units_read_s": "62583",
"data_units_read_le": [
119,
244
],
"data_units_written": 653243,
"data_units_written_s": "653243",
"data_units_written_le": [
187,
247,
9
],
"host_reads": 1011196,
"host_reads_s": "1011196",
"host_reads_le": [
252,
109,
15
],
"host_writes": 4432307,
"host_writes_s": "4432307",
"host_writes_le": [
179,
161,
67
],
"controller_busy_time": 8,
"controller_busy_time_s": "8",
"controller_busy_time_le": [
8
],
"power_cycles": 140,
"power_cycles_s": "140",
"power_cycles_le": [
140
],
"power_on_hours": 40,
"power_on_hours_s": "40",
"power_on_hours_le": [
40
],
"unsafe_shutdowns": 11,
"unsafe_shutdowns_s": "11",
"unsafe_shutdowns_le": [
11
],
"media_errors": 0,
"media_errors_s": "0",
"num_err_log_entries": 161,
"num_err_log_entries_s": "161",
"num_err_log_entries_le": [
161
],
"warning_temp_time": 0,
"critical_comp_time": 0,
"temperature_sensors": [
32,
35
]
},
"temperature": {
"current": 32
},
"power_cycle_count": 140,
"power_on_time": {
"hours": 40
}
}
Updated by Jannik Schönartz almost 4 years ago
- % Done changed from 0 to 30
Sollte so passen. JSON Output gibt es erst ab Version 7.0.
In Ubuntu 20.04 ist 7.1 drin.
In Ubuntu 18.04 ist es noch 6.6 und damit nicht ausreichend.
In Debian ist wohl auch noch 6.6.
Im idoit gibt es einen Server der als OS CentOS 7 eingetragen hat.
Da dürfte zumindest Version 7 dabei sein.
https://centos.pkgs.org/7/centos-x86_64/smartmontools-7.0-2.el7.x86_64.rpm.html
Updated by Michael Janczyk almost 4 years ago
CentOS 7.8 (und drunter werden wir nicht gehen) ist bereits Version 7.0 enthalten.
smartctl 7.0 2018-12-30 r4883 [x86_64-linux-3.10.0-1127.13.1.el7.x86_64] (local build)
# smartctl --json=v -a /dev/sda { "json_format_version": [ 1, 0 ], "smartctl": { "version": [ 7, 0 ], "svn_revision": "4883", "platform_info": "x86_64-linux-3.10.0-1127.13.1.el7.x86_64", "build_info": "(local build)", "argv": [ "smartctl", "--json=v", "-a", "/dev/sda" ], "exit_status": 0 }, "device": { "name": "/dev/sda", "info_name": "/dev/sda [SAT]", "type": "sat", "protocol": "ATA" }, "model_family": "Intel 730 and DC S35x0/3610/3700 Series SSDs", "model_name": "INTEL SSDSC2BB240G7", "serial_number": "BTDV727303MR240AGN", "wwn": { "naa": 5, "oui": 6083300, "id": 5601119165 }, "firmware_version": "N2010112", "user_capacity": { "blocks": 468862128, "blocks_s": "468862128", "bytes": 240057409536, "bytes_s": "240057409536" }, "logical_block_size": 512, "physical_block_size": 4096, "rotation_rate": 0, "form_factor": { "ata_value": 3, "name": "2.5 inches" }, "in_smartctl_database": true, "ata_version": { "string": "ACS-3 T13/2161-D revision 5", "major_value": 2044, "minor_value": 109 }, "sata_version": { "string": "SATA 3.1", "value": 127 }, "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": 1595581948, "asctime": "Fri Jul 24 11:12:28 2020 CEST" }, "smart_status": { "passed": true }, "ata_smart_data": { "offline_data_collection": { "status": { "value": 0, "string": "was never started" }, "completion_seconds": 0 }, "self_test": { "status": { "value": 0, "string": "completed without error", "passed": true }, "polling_minutes": { "short": 1, "extended": 2, "conveyance": 2 } }, "capabilities": { "values": [ 121, 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": true, "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": 1, "table": [ { "id": 5, "name": "Reallocated_Sector_Ct", "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": 9, "name": "Power_On_Hours", "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": 24383, "string": "24383" } }, { "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": 62, "string": "62" } }, { "id": 170, "name": "Available_Reservd_Space", "value": 100, "worst": 100, "thresh": 10, "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": 171, "name": "Program_Fail_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": 172, "name": "Erase_Fail_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": 174, "name": "Unsafe_Shutdown_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": 14, "string": "14" } }, { "id": 175, "name": "Power_Loss_Cap_Test", "value": 100, "worst": 100, "thresh": 10, "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": 871947189578, "string": "15690 (203 1050)" } }, { "id": 183, "name": "SATA_Downshift_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": 184, "name": "End-to-End_Error", "value": 100, "worst": 100, "thresh": 90, "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": 187, "name": "Reported_Uncorrect", "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": 190, "name": "Temperature_Case", "value": 77, "worst": 77, "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": 403701783, "string": "23 (Min/Max 16/24)" } }, { "id": 192, "name": "Unsafe_Shutdown_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": 14, "string": "14" } }, { "id": 194, "name": "Temperature_Internal", "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": 23, "string": "23" } }, { "id": 197, "name": "Current_Pending_Sector", "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": 0, "string": "0" } }, { "id": 199, "name": "CRC_Error_Count", "value": 100, "worst": 100, "thresh": 0, "when_failed": "", "flags": { "value": 62, "string": "-OSRCK ", "prefailure": false, "updated_online": true, "performance": true, "error_rate": true, "event_count": true, "auto_keep": true }, "raw": { "value": 0, "string": "0" } }, { "id": 225, "name": "Host_Writes_32MiB", "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": 222744, "string": "222744" } }, { "id": 226, "name": "Workld_Media_Wear_Indic", "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": 860, "string": "860" } }, { "id": 227, "name": "Workld_Host_Reads_Perc", "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": 228, "name": "Workload_Minutes", "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": 1462813, "string": "1462813" } }, { "id": 232, "name": "Available_Reservd_Space", "value": 100, "worst": 100, "thresh": 10, "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": 233, "name": "Media_Wearout_Indicator", "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": 234, "name": "Thermal_Throttle", "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/0" } }, { "id": 241, "name": "Host_Writes_32MiB", "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": 222744, "string": "222744" } }, { "id": 242, "name": "Host_Reads_32MiB", "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": 495, "string": "495" } }, { "id": 243, "name": "NAND_Writes_32MiB", "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": 415558, "string": "415558" } } ] }, "power_on_time": { "hours": 24383 }, "power_cycle_count": 62, "temperature": { "current": 23 }, "ata_smart_error_log": { "summary": { "revision": 1, "count": 0 } }, "ata_smart_self_test_log": { "standard": { "revision": 1, "count": 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 } }
Updated by Jannik Schönartz over 3 years ago
- Status changed from New to Closed
- Assignee changed from BAS-Crew to Jannik Schönartz
- % Done changed from 30 to 100
Perfekt. Hab ich dann mal ins python script implementiert. (commit)
Updated by Jannik Schönartz over 3 years ago
- Assignee changed from Jannik Schönartz to Simon Rettberg
- % Done changed from 100 to 90
Also ich lese für smartctl wie bei euch im Skript /dev/disk/by-path aus und filter alle usb und -part dinger raus.
Das Problem dabei ist, dass es schwierig ist zu unterscheiden, was hier ein CD/DVD Laufwerk, was eine HDD und was eine SSD ist.
Für SSD und HDD würde ich vorschlagen, einfach unter den ata_smart_attributes zu schauen, ob es das Attribut "Spin_Up_Time" gibt.
Falls ja -> HDD ansonsten SSD.
Für Laufwerke könnte man schauen, ob es "user_capacity" gibt. Falls nicht, sollte es ja ein Laufwerk sein.
Kann man das so machen? Reicht das aus oder bekommt man diese Info woanderst etwas zuverlässiger?
Updated by Steffen Ritter over 3 years ago
- Status changed from Closed to Feedback
Updated by Simon Rettberg over 3 years ago
SSD haben RPM = 0
CD/DVD könnte man vermutlich auch über sysfs rausfinden. Andere billige Lösung wäre, readlink -f und gucken ob es /dev/sr* ist.
Updated by Simon Rettberg over 3 years ago
- Assignee changed from Simon Rettberg to Jannik Schönartz
Updated by Jannik Schönartz over 3 years ago
- Assignee changed from Jannik Schönartz to Simon Rettberg
RPM = 0 klingt gut. Dann nehme ich bei smartctl das entsprechende Attribut "rotation_rate".
Für Laufwerke teste ich mal noch bisschen rum. Für sysfs oder readlink müssten ja wieder extra Infos von dem pythonscript gespeichert werden.
Und dann muss man ja immer noch schauen, wie man beim parsen von smartctl CD/DVD Laufwerke am besten rausfiltert.
Updated by Jannik Schönartz over 3 years ago
- % Done changed from 90 to 100
Bei meinem Arbeits-PC sind das alle Daten, die smartctl zum Laufwerk zurück gibt:
smartctl -a --json /dev/disk/by-path/pci-0000\:00\:17.0-ata-2smartctl -a --json /dev/disk/by-path/pci-0000\:00\:17.0-ata-2
{
"json_format_version": [
1,
0
],
"smartctl": {
"version": [
7,
1
],
"svn_revision": "5022",
"platform_info": "x86_64-linux-5.4.0-65-generic",
"build_info": "(local build)",
"argv": [
"smartctl",
"-a",
"--json",
"/dev/disk/by-path/pci-0000:00:17.0-ata-2"
],
"exit_status": 2
},
"device": {
"name": "/dev/disk/by-path/pci-0000:00:17.0-ata-2",
"info_name": "/dev/disk/by-path/pci-0000:00:17.0-ata-2",
"type": "scsi",
"protocol": "SCSI"
},
"vendor": "TSSTcorp",
"product": "CDDVDW SH-216FB",
"model_name": "TSSTcorp CDDVDW SH-216FB",
"revision": "FT00",
"scsi_version": "SPC-3"
}
Beim Product und Model Name kann man vermutlich nicht immer davon ausgehen, dass es CDDVD enthält, "readlink -f" würde gut funktionieren.
Das könnte ich einfach in der For-Loop im Pythonscript für jede Disk ausführen und ins smartctl JSON reinschreiben, dann wäre es auch direkt an der richtigen Stelle.
Dann ist es halt nicht mehr 1:1 das von smartctl generierte JSON, aber das sollte ja kein Problem sein oder?
Ich würde dann einfach ein attribut "readlink" mit der entsprechenden Antwort hinzufügen.
{
[...],
"readlink": "/dev/sr0"
}
Updated by Jannik Schönartz almost 3 years ago
Das Schema, wo smartctl im JSON zu finden ist, hat sich etwas geändert.