ataprint.cpp, nvmeprint.cpp: Add JSON values 'smart_support.*' to keep

consistency with scsiprint.cpp.

git-svn-id: http://svn.code.sf.net/p/smartmontools/code/trunk@5218 4ea69e1a-61f1-4043-bf83-b5c94c648137
pull/99/head
chrfranke 1 year ago
parent 14b3dfbdf5
commit 1151fb1b32
  1. 5
      smartmontools/ChangeLog
  2. 12
      smartmontools/ataprint.cpp
  3. 3
      smartmontools/nvmeprint.cpp

@ -1,5 +1,10 @@
$Id$
2021-06-04 Christian Franke <franke@computer.org>
ataprint.cpp, nvmeprint.cpp: Add JSON values 'smart_support.*' to
keep consistency with scsiprint.cpp.
2021-05-02 Douglas Gilbert <dgilbert@interlog.com>
scsiprint.cpp: continue JSON work

@ -3528,10 +3528,10 @@ int ataPrintMain (ata_device * device, const ata_print_options & options)
if (smart_supported < 0)
pout("SMART support is: Unknown - Try option -s with argument 'on' to enable it.");
else if (!smart_supported)
pout("SMART support is: Unavailable - device lacks SMART capability.\n");
jout("SMART support is: Unavailable - device lacks SMART capability.\n");
else {
if (options.drive_info)
pout("SMART support is: Available - device has SMART capability.\n");
jout("SMART support is: Available - device has SMART capability.\n");
if (smart_enabled >= 0) {
if (device->ata_identify_is_cached()) {
if (options.drive_info)
@ -3540,11 +3540,17 @@ int ataPrintMain (ata_device * device, const ata_print_options & options)
smart_enabled = ataDoesSmartWork(device);
}
if (options.drive_info)
pout("SMART support is: %s\n",
jout("SMART support is: %s\n",
(smart_enabled ? "Enabled" : "Disabled"));
}
}
}
if (options.drive_info || smart_supported <= 0) {
jglb["smart_support"]["available"] = (smart_supported > 0);
if (smart_supported > 0)
jglb["smart_support"]["enabled"] = (smart_enabled > 0);
}
}
// Print AAM status

@ -201,6 +201,9 @@ static void print_drive_info(const nvme_id_ctrl & id_ctrl, const nvme_id_ns & id
}
}
// SMART/Health Information is mandatory
jglb["smart_support"] += { {"available", true}, {"enabled", true} };
jout_startup_datetime("Local Time is: ");
}

Loading…
Cancel
Save