From b25890097e7dfaa2d7a4dbf703f289a74720452c Mon Sep 17 00:00:00 2001 From: Tim Keller Date: Fri, 12 Sep 2025 22:32:35 -0500 Subject: remove diskhealth script for qdiskinfo instead --- misc/diskhealth | 46 ---------------------------------------------- 1 file changed, 46 deletions(-) delete mode 100755 misc/diskhealth (limited to 'misc') diff --git a/misc/diskhealth b/misc/diskhealth deleted file mode 100755 index 5cce07b..0000000 --- a/misc/diskhealth +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env python3 - -import subprocess -import json -from pprint import pprint - -smart_result = subprocess.run(["sudo", "smartctl", "-Aij", "/dev/sda"], capture_output=True, text=True) - -smart_result = json.loads(smart_result.stdout) - -sector_size = smart_result["logical_block_size"] - -from typing import NamedTuple -class RawValue(NamedTuple): - value: int - string: str - -class Flags(NamedTuple): - value: int - string: str - prefailure: bool - updated_online: bool - performance: bool - error_rate: bool - event_count: bool - auto_keep: bool - -class SmartAttribute(NamedTuple): - id: int - name: str - value: int - worst: int - thresh: int - when_failed: str - flags: dict - raw: dict - -attributes = {} - -for attr in smart_result["ata_smart_attributes"]["table"]: - attr_l = SmartAttribute(**attr) - attributes[attr_l.id] = attr_l - -if 241 in attributes: - lbas_written = attributes[241].raw["value"] - print((lbas_written * sector_size) / 10**12) -- cgit v1.2.3