diff --git a/scsiprint.cpp b/scsiprint.cpp
index cca0dcc..755b6ba 100644
a
|
b
|
scsiGetSmartData(scsi_device * device, bool attribs) |
333 | 333 | if (255 == triptemp) |
334 | 334 | pout("Drive Trip Temperature: <not available>\n"); |
335 | 335 | else |
| 336 | { |
336 | 337 | pout("Drive Trip Temperature: %d C\n", triptemp); |
| 338 | jglb["temperature"]["drive_trip"] = triptemp; |
| 339 | } |
337 | 340 | } |
338 | 341 | pout("\n"); |
339 | 342 | return err; |
… |
… |
scsiPrintGrownDefectListLen(scsi_device * device) |
610 | 613 | break; |
611 | 614 | } |
612 | 615 | if (0 == dl_len) |
| 616 | { |
613 | 617 | pout("Elements in grown defect list: 0\n\n"); |
| 618 | jglb["elements_grown_list"] = 0; |
| 619 | } |
614 | 620 | else { |
615 | 621 | if (0 == div) |
616 | 622 | pout("Grown defect list length=%u bytes [unknown " |
617 | 623 | "number of elements]\n\n", dl_len); |
618 | 624 | else |
| 625 | { |
619 | 626 | pout("Elements in grown defect list: %u\n\n", dl_len / div); |
| 627 | jglb["elements_grown_list"] = dl_len; |
| 628 | } |
620 | 629 | } |
621 | 630 | } |
622 | 631 | |
… |
… |
scsiPrintSeagateFactoryLPage(scsi_device * device) |
704 | 713 | int num, pl, pc, len, err, good, bad; |
705 | 714 | unsigned char * ucp; |
706 | 715 | uint64_t ull; |
| 716 | static const char * jname = "format_status"; |
707 | 717 | |
708 | 718 | if ((err = scsiLogSense(device, SEAGATE_FACTORY_LPAGE, 0, gBuf, |
709 | 719 | LOG_RESP_LEN, 0))) { |
… |
… |
scsiPrintSeagateFactoryLPage(scsi_device * device) |
759 | 769 | good = 0; |
760 | 770 | switch (pc) { |
761 | 771 | case 0: pout(" number of hours powered up"); |
| 772 | jname = "hours_powered_up"; |
762 | 773 | good = 1; |
763 | 774 | break; |
764 | 775 | case 8: pout(" number of minutes until next internal SMART test"); |
| 776 | jname = "minutes_next_smart_test"; |
765 | 777 | good = 1; |
766 | 778 | break; |
767 | 779 | default: |
… |
… |
scsiPrintSeagateFactoryLPage(scsi_device * device) |
782 | 794 | } |
783 | 795 | ull = sg_get_unaligned_be(k, xp + 0); |
784 | 796 | if (0 == pc) |
| 797 | { |
785 | 798 | pout(" = %.2f\n", ull / 60.0 ); |
| 799 | jglb[jname] = strprintf("%.2f", ull / 60.0); |
| 800 | } |
786 | 801 | else |
| 802 | { |
787 | 803 | pout(" = %" PRIu64 "\n", ull); |
| 804 | jglb[jname] = ull; |
| 805 | } |
788 | 806 | } |
789 | 807 | num -= pl; |
790 | 808 | ucp += pl; |
… |
… |
scsiPrintErrorCounterLog(scsi_device * device) |
828 | 846 | "algorithm processed uncorrected\n"); |
829 | 847 | pout(" fast | delayed rewrites corrected " |
830 | 848 | "invocations [10^9 bytes] errors\n"); |
| 849 | |
831 | 850 | for (int k = 0; k < 3; ++k) { |
832 | 851 | if (! found[k]) |
833 | 852 | continue; |
834 | 853 | ecp = &errCounterArr[k]; |
835 | 854 | static const char * const pageNames[3] = |
836 | 855 | {"read: ", "write: ", "verify: "}; |
| 856 | static const char * jpageNames[3] = |
| 857 | {"read", "write", "verify"}; |
837 | 858 | pout("%s%8" PRIu64 " %8" PRIu64 " %8" PRIu64 " %8" PRIu64 |
838 | 859 | " %8" PRIu64, pageNames[k], ecp->counter[0], |
839 | 860 | ecp->counter[1], ecp->counter[2], ecp->counter[3], |
… |
… |
scsiPrintErrorCounterLog(scsi_device * device) |
841 | 862 | double processed_gb = ecp->counter[5] / 1000000000.0; |
842 | 863 | pout(" %12.3f %8" PRIu64 "\n", processed_gb, |
843 | 864 | ecp->counter[6]); |
| 865 | // Error counter log info |
| 866 | jglb["error_counter_log"][jpageNames[k]]["errors_corrected_by_eccfast"] = ecp->counter[0]; |
| 867 | jglb["error_counter_log"][jpageNames[k]]["errors_corrected_by_eccdelayed"] = ecp->counter[1]; |
| 868 | jglb["error_counter_log"][jpageNames[k]]["errors_corrected_by_rereads_rewrites"] = ecp->counter[2]; |
| 869 | jglb["error_counter_log"][jpageNames[k]]["total_errors_corrected"] = ecp->counter[3]; |
| 870 | jglb["error_counter_log"][jpageNames[k]]["correction_algorithm_invocations"] = ecp->counter[4]; |
| 871 | jglb["error_counter_log"][jpageNames[k]]["gigabytes_processed"] = strprintf("%.3f", processed_gb); |
| 872 | jglb["error_counter_log"][jpageNames[k]]["total_uncorrected_errors"] = ecp->counter[6]; |
844 | 873 | } |
845 | 874 | } |
846 | 875 | else |
… |
… |
scsiPrintBackgroundResults(scsi_device * device) |
1177 | 1206 | j = sg_get_unaligned_be32(ucp + 4); |
1178 | 1207 | pout(" Accumulated power on time, hours:minutes %d:%02d " |
1179 | 1208 | "[%d minutes]\n", (j / 60), (j % 60), j); |
| 1209 | jglb["accumulated_power_on_time_minutes"] = j; |
1180 | 1210 | pout(" Number of background scans performed: %d, ", |
1181 | 1211 | sg_get_unaligned_be16(ucp + 10)); |
| 1212 | jglb["number_sacns_performed"] = sg_get_unaligned_be16(ucp + 10); |
1182 | 1213 | pout("scan progress: %.2f%%\n", |
1183 | 1214 | (double)sg_get_unaligned_be16(ucp + 12) * 100.0 / 65536.0); |
1184 | 1215 | pout(" Number of background medium scans performed: %d\n", |
1185 | 1216 | sg_get_unaligned_be16(ucp + 14)); |
| 1217 | jglb["number_medium_scans_performed"] = sg_get_unaligned_be16(ucp + 14); |
1186 | 1218 | break; |
1187 | 1219 | default: |
1188 | 1220 | if (noheader) { |
… |
… |
scsiPrintSSMedia(scsi_device * device) |
1275 | 1307 | return FAILSMART; |
1276 | 1308 | } |
1277 | 1309 | pout("Percentage used endurance indicator: %d%%\n", ucp[7]); |
| 1310 | jglb["percentage_used_endurance_indicator"] = ucp[7]; |
1278 | 1311 | default: /* ignore other parameter codes */ |
1279 | 1312 | break; |
1280 | 1313 | } |
… |
… |
scsiPrintTemp(scsi_device * device) |
2225 | 2258 | if (255 == trip) |
2226 | 2259 | pout("Drive Trip Temperature: <not available>\n"); |
2227 | 2260 | else |
| 2261 | { |
2228 | 2262 | pout("Drive Trip Temperature: %d C\n", trip); |
| 2263 | jglb["temperature"]["drive_trip"] = trip; |
| 2264 | } |
2229 | 2265 | pout("\n"); |
2230 | 2266 | } |
2231 | 2267 | |