1. 23 Sep, 2021 1 commit
  2. 19 Sep, 2021 6 commits
  3. 20 Aug, 2021 2 commits
    • Chuck Tuffli's avatar
      fix: display of threshold values · 814bae74e612
      Chuck Tuffli authored
      This fixes multiple issues when printing the threshold values in ATA
      including:
       - separate threshold values with tabs, not spaces
       - code was printing flags, current, worst but not the threshold value
       - __smart_map_ata_thresh pointer arithmetic mistake
      814bae74e612
    • Chuck Tuffli's avatar
      fix: simplify LIBXO ifdef · e0c567c22756
      Chuck Tuffli authored
      Use macros to consolidate the printing difference when using libxo (i.e.
      xo_emit("...")) and when not (i.e. printf("...")). This makes the code
      easier to read as the pattern
      	#ifndef LIBXO
      		printf("...");
      	#else
      		xo_emit("...");
      	#endif
      
      is replaced by
      	__smart_print_val(FMT_MACRO);
      e0c567c22756
  4. 11 Aug, 2021 1 commit
    • Chuck Tuffli's avatar
      feat: make attribute decode an option · 4fef65204f21
      Chuck Tuffli authored
      Instead of unconditionally decoding the attribute ID's, add two new
      options:
        --decode, -d    : decodes the attribute ID into text
        --no-decode, -D : don't decode the attribute ID into text
      
      If the program is invoked as 'smart', it defaults to the original
      behavior of only printing values (i.e. '--no-decode'). But if the
      program is invoked as 'diskhealth', it defaults to decoding the
      attribute ID and printing the value (i.e. '--decode'). Note that the
      'decode' behavior skips printing the page ID and attribute ID.
      
      While in the neighborhood, create macros for the flag values passed to
      smart_open().
      4fef65204f21
  5. 09 Aug, 2021 2 commits
  6. 08 Aug, 2021 1 commit
  7. 06 Aug, 2021 3 commits
  8. 03 Aug, 2021 4 commits
  9. 02 Aug, 2021 1 commit
  10. 03 Aug, 2021 1 commit
  11. 21 Jul, 2021 1 commit
  12. 17 May, 2021 1 commit
    • Chuck Tuffli's avatar
      add libxo support · 0c2dd6a41eb5
      Chuck Tuffli authored
      Commit adds libxo (https://github.com/awf/libxo), but the usage is
      wrapped in ifdef LIBXO macros and can be compiled out. By default, the
      output defaults to plain text. To select one of the other supported
      output formats (e.g. xml, json, html), use the --libxo command line
      option.
      0c2dd6a41eb5
  13. 05 Dec, 2018 2 commits
    • Chuck Tuffli's avatar
      Add SCSI Informational Exceptions log page · 7efbd3e9a8b0
      Chuck Tuffli authored
      This adds support for the SCSI Informational Exceptions log page which
      contains a list of Additional Sense Codes and Qualifiers as well as the
      most recent temperature reading.
      
      Some applications use this page as a sort of top-level SMART health
      indication.
      
      Also fix display problem with several SCSI error count log pages due to
      endianess and displaying bogus temperature readings. Updated scsismart
      example script.
      
      addresses issue #5
      7efbd3e9a8b0
    • Chuck Tuffli's avatar
      Add ATA SMART Return Status · bfe67bcef934
      Chuck Tuffli authored
      This adds support for the ATA SMART Return Status command to retrieve
      the reliability status of the device. The command encodes the status in
      the LBA high and mid registers, and either indicates:
       - The device has detected a threshold exceeded condition (a.k.a. bad)
       - The captive self-test completed without error (a.k.a. good)
      
      While the command does not return data, the program encodes the above
      status into the data buffer at offset / attribute 0x0. A good status
      (i.e. LBA high/mid = 0xc24f) is encoded as a 0. A bad status (i.e. LBA
      high/mid = 0x2cf4) is encoded as a 1.
      
      Some applications use this command as a sort of top-level SMART health
      indication.
      
      addresses issue #5
      bfe67bcef934
  14. 12 Oct, 2018 1 commit
  15. 10 Oct, 2018 4 commits
    • Chuck Tuffli's avatar
      Bump version to 0.0.11 · 109fea276322
      Chuck Tuffli authored
      Fixes:
       - remove extra new-line when printing 128-bit numbers
       - Avoid possible buffer over-run
       - Fix gcc build error
      109fea276322
    • Chuck Tuffli's avatar
      Fix gcc compilation error · 41c031109275
      Chuck Tuffli authored
      gcc doesn't allow the use of constant variables in array calculations
      like clang does which causes FreeBSD port build failures on arch's which
      don't use clang (e.g. mips, powerpc, etc).
      
      Fix is to move the const variable to a macro.
      
      resolved bug #9
      41c031109275
    • Chuck Tuffli's avatar
      Fix the maximum attribute calculations · 952b454aae8b
      Chuck Tuffli authored
      Allocation of the smart map uses the attr_count variable. But, in the
      case of NVMe and SCSI, the code was returning zero opening the
      possibility of a buffer overrun as the subsequent code didn't check for
      this case.
      
      Fix is to return a non-zero default value for NVMe and SCSI maximum
      attribute calculations in addition to checking for a zero count in the
      map allocation code itself.
      952b454aae8b
    • Chuck Tuffli's avatar
      Fix assorted minor issues · f53cc5f75317
      Chuck Tuffli authored
      This includes a white-space change, removing an extra new-line when
      printing 128 bit numbers, and assigning a missing return value.
      f53cc5f75317
  16. 26 Aug, 2018 1 commit
  17. 26 Mar, 2018 1 commit
  18. 26 Aug, 2018 1 commit
    • Chuck Tuffli's avatar
      Fix NVMe build on FreeBSD · ee728852533b
      Chuck Tuffli authored
      The release version of FreeBSD 12.0 fixed the NVMe KPI to be compatible
      with 11.x by removing the opc_fuse uint16_t and replacing it with two
      uint8_t's for opc and fuse.
      
      This updates smart to use the compatible KPI and drops support for the
      old version.
      ee728852533b
  19. 03 Apr, 2018 3 commits
    • Chuck Tuffli's avatar
      a7186761b3b8
    • Chuck Tuffli's avatar
      Document and fix ATA threshold option · 42c26f619d8d
      Chuck Tuffli authored
      The --threshold option prints the 4 bytes between the attribute ID and
      the raw attribute value. Document in the README these make up the flags
      (2 bytes), current value, and worst value.
      
      The existing code had two usability issues. First, it printed the 4 byte
      values individually instead of combining the first two bytes into the
      flags value. Fix is to group the bytes into the natural 3 values.
      Second, the application always printed the raw value last, but this
      means its field number changes depending on the presence of the
      threshold values. Fix is to print the threshold values last.
      
      resolved bug #6
      42c26f619d8d
    • Chuck Tuffli's avatar
      Added tag 0.0.9 for changeset 9696b3729742 · 24a96c511f35
      Chuck Tuffli authored
      Fixes a bug in the maximum number of ATA entries
      24a96c511f35
  20. 30 Mar, 2018 1 commit
    • Chuck Tuffli's avatar
      Fix ATA attribute max · 9696b3729742
      Chuck Tuffli authored
      The data returned by SMART READ DATA uses bytes 0-361 for vendor
      specific data. This is where attributes can be found. Skipping the two
      bytes of version and knowing that each entry is 12 bytes, there are a
      maximum of 30 entries.
      
      The application was assuming the entire allocated buffer contained
      attributes and mistakenly interpreted other fields of the data
      structure as attributes. This lead to reports of 're-used attributes'.
      
      Fix is to return 30 from __smart_attr_max_ata().
      
      resolved bug #4
      9696b3729742
  21. 20 Mar, 2018 2 commits