Using MI
First, ensure that you have the latest version of the sanblaze Python package installed.
sb_python -m pip install sanblaze --pre --upgrade
Then do the following in an sb_python interpreter, or a script:
Import the new
MIobject.>>> from sanblaze import MICreate an instance of
MI, and pass in the target number of your device on the system.>>> m = MI(101)Inside of a
m.mi.utils.vdm()context manager, callget_log_pageon the instance, with your desired parameters. The context manager will tunnel theget_log_pagecall through the VDM transport instead of sending it directly to the device. Note thatmshould be changed to whatever you called theMIinstance.>>> with m.mi.utils.vdm(): ... result = m.get_log_page(2, nsid=1, rae=1) ...
result will contain a dictionary with the parsed drive response and other helpful information.
{ 'status': 0, 'reason': 'Success', 'cqe': {'DW2': {'SQID': 0, 'SQHD': 0}, 'DW3': {'SF': {'DNR': 0, 'M': 0, 'CRD': 0, 'SCT': 0, 'SC': 0}, 'P': 0, 'CID': 0}}, 'time_us': 0, 'data': {'Critical Warning': 0, 'Composite Temperature': 317, 'Available Spare': 100, 'Available Spare Threshold': 10, 'Percentage Used': 2, 'Endurance Group Critical Warning Summary': 0, 'Data Units Read': 148067068, 'Data Units Written': 93531881, 'Host Read Commands': 4725667662, 'Host Write Commands': 1980399564, 'Controller Busy Time': 1889, 'Power Cycles': 991, 'Power On Hours': 23448, 'Unsafe Shutdowns': 113, 'Media and Data Integrity Errors': 23, 'Number of Error Information Log Entries': 46, 'Warning Composite Temperature Time': 0, 'Critical Composite Temperature Time': 0, 'Temperature Sensor 1': {'TST': 314}, 'Temperature Sensor 2': {'TST': 313}, 'Temperature Sensor 3': {'TST': 318}, 'Temperature Sensor 4': {'TST': 0}, 'Temperature Sensor 5': {'TST': 0}, 'Temperature Sensor 6': {'TST': 0}, 'Temperature Sensor 7': {'TST': 0}, 'Temperature Sensor 8': {'TST': 0}, 'Thermal Management Temperature 1 Transition Count': 0, 'Thermal Management Temperature 2 Transition Count': 0, 'Total Time for Thermal Management Temperature 1': 0, 'Total Time for Thermal Management Temperature 2': 0} }
'status' is 0 if the command was successful, and 1 otherwise.'reason' will provide an explanation of the status.'cqe' is the parsed Completion Queue Entry.'time_us' will be 0.'data' is the parsed data buffer returned from the drive.You can use display to view the contents of 'data' in an easily readable format:
>>> result['data'].display() Get Log Page - SMART / Health Information Log --------------------------------------------- Critical Warning 00h Composite Temperature 013Dh Available Spare 64h Available Spare Threshold 0Ah Percentage Used 02h Endurance Group Critical Warning Summary 00h Data Units Read 00000000_00000000_00000000_08D352FCh Data Units Written 00000000_00000000_00000000_05932EE9h Host Read Commands 00000000_00000000_00000001_19ABF74Eh Host Write Commands 00000000_00000000_00000000_760A7FCCh Controller Busy Time 00000000_00000000_00000000_00000761h Power Cycles 00000000_00000000_00000000_000003DFh Power On Hours 00000000_00000000_00000000_00005B98h Unsafe Shutdowns 00000000_00000000_00000000_00000071h Media and Data Integrity Errors 00000000_00000000_00000000_00000017h Number of Error Information Log Entries 00_00000000_00000000_00000000_0000002Eh Warning Composite Temperature Time 00000000h Critical Composite Temperature Time 00000000h Temperature Sensor 1 : TST 0000_0001_0011_1010b Temperature Sensor 2 : TST 0000_0001_0011_1001b Temperature Sensor 3 : TST 0000_0001_0011_1110b Temperature Sensor 4 : TST 0000_0000_0000_0000b Temperature Sensor 5 : TST 0000_0000_0000_0000b Temperature Sensor 6 : TST 0000_0000_0000_0000b Temperature Sensor 7 : TST 0000_0000_0000_0000b Temperature Sensor 8 : TST 0000_0000_0000_0000b Thermal Management Temperature 1 Transition Count 00000000h Thermal Management Temperature 2 Transition Count 00000000h Total Time for Thermal Management Temperature 1 00000000h Total Time for Thermal Management Temperature 2 00000000h