Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export whether SMART is available for a device #224

Open
ben-z opened this issue Apr 23, 2024 · 0 comments
Open

Export whether SMART is available for a device #224

ben-z opened this issue Apr 23, 2024 · 0 comments

Comments

@ben-z
Copy link

ben-z commented Apr 23, 2024

Currently, we only check whether smart_status.passed is true. If it's false, then assume SMART did not pass. However, there's another possibility that the device doesn't support SMART at all.

smart.json.Get("smart_status.passed").Float(),

I have a MegaRAID device that exhibits this behaviour:

root@wato-derek2:~# smartctl /dev/sda -a
smartctl 7.2 2020-12-30 r5155 [x86_64-linux-5.4.119-1-pve] (local build)
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Vendor:               IBM
Product:              ServeRAID M5015
Revision:             2.13
Compliance:           SPC-3
User Capacity:        47,999,999,803,392 bytes [47.9 TB]
Logical block size:   512 bytes
Logical Unit id:      0x600605b0041170402ad08eba1fe4604f
Serial number:        004f60e41fba8ed02a40701104b00506
Device type:          disk
Local Time is:        Tue Apr 23 02:40:30 2024 EDT
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

Device does not support Self Test logging
{
  "json_format_version": [
    1,
    0
  ],
  "smartctl": {
    "version": [
      7,
      2
    ],
    "svn_revision": "5155",
    "platform_info": "x86_64-linux-5.4.119-1-pve",
    "build_info": "(local build)",
    "argv": [
      "smartctl",
      "/dev/sda",
      "--json",
      "--info",
      "--health",
      "--attributes",
      "--tolerance=verypermissive",
      "--nocheck=standby",
      "--format=brief",
      "--log=error"
    ],
    "exit_status": 0
  },
  "device": {
    "name": "/dev/sda",
    "info_name": "/dev/sda",
    "type": "scsi",
    "protocol": "SCSI"
  },
  "vendor": "IBM",
  "product": "ServeRAID M5015",
  "model_name": "IBM ServeRAID M5015",
  "revision": "2.13",
  "scsi_version": "SPC-3",
  "user_capacity": {
    "blocks": 93749999616,
    "bytes": 47999999803392
  },
  "logical_block_size": 512,
  "serial_number": "004f60e41fba8ed02a40701104b00506",
  "device_type": {
    "scsi_value": 0,
    "name": "disk"
  },
  "local_time": {
    "time_t": 1713854444,
    "asctime": "Tue Apr 23 02:40:44 2024 EDT"
  },
  "temperature": {
    "current": 0,
    "drive_trip": 0
  }
}

There should be a check to see if the smart_status object is available. If it is not, then SMART is not available for the device.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant