lib/utils/job-utils/command-parser.js
function _parseSmartAttributes(lines) {
        var attrObj = {};
        /* Example data:
         SMART Attributes Data Structure revision number: 1
         Vendor Specific SMART Attributes with Thresholds:
         ID# ATTRIBUTE_NAME       FLAG    VALUE WORST THRESH TYPE      UPDATED
           1 Raw_Read_Error_Rate  0x0003  100   100   006    Pre-fail  Always
           3 Spin_Up_Time         0x0003  100   100   000    Pre-fail  Always
           4 Start_Stop_Count     0x0002  100   100   020    Old_age   Always
        */
        //Parse first line to get revision number
        //Example data: "SMART Attributes Data Structure revision number: 16"
        if (lines.length > 0) {
            attrObj.Revision = (lines[0].substring(lines[0].lastIndexOf(' ') + 1)).trim();
        }
        attrObj['Attributes Table'] = _parseSmartTable(lines, 2, /\s+/);
        return attrObj;
    }
function _parseSmartAttributes(lines) {
        var attrObj = {};
        /* Example data:
         SMART Attributes Data Structure revision number: 1
         Vendor Specific SMART Attributes with Thresholds:
         ID# ATTRIBUTE_NAME       FLAG    VALUE WORST THRESH TYPE      UPDATED
           1 Raw_Read_Error_Rate  0x0003  100   100   006    Pre-fail  Always
           3 Spin_Up_Time         0x0003  100   100   000    Pre-fail  Always
           4 Start_Stop_Count     0x0002  100   100   020    Old_age   Always
        */
        //Parse first line to get revision number
        //Example data: "SMART Attributes Data Structure revision number: 16"
        if (lines.length > 0) {
            attrObj.Revision = (lines[0].substring(lines[0].lastIndexOf(' ') + 1)).trim();
        }
        attrObj['Attributes Table'] = _parseSmartTable(lines, 2, /\s+/);
        return attrObj;
    }
function _parseSmartAttributes ( lines ) { var attrObj = { } ; /* Example data:
         SMART Attributes Data Structure revision number: 1
         Vendor Specific SMART Attributes with Thresholds:
         ID# ATTRIBUTE_NAME       FLAG    VALUE WORST THRESH TYPE      UPDATED
           1 Raw_Read_Error_Rate  0x0003  100   100   006    Pre-fail  Always
           3 Spin_Up_Time         0x0003  100   100   000    Pre-fail  Always
           4 Start_Stop_Count     0x0002  100   100   020    Old_age   Always
        */ //Parse first line to get revision number //Example data: "SMART Attributes Data Structure revision number: 16" if ( lines . length > 0 ) { attrObj . Revision = ( lines [ 0 ] . substring ( lines [ 0 ] . lastIndexOf ( ' ' ) + 1 ) ) . trim ( ) ; } attrObj [ 'Attributes Table' ] = _parseSmartTable ( lines , 2 , / \s+ / ) ; return attrObj ; }
Parse the SMART attribute table

@param {Array} The input data that has been splitted by line.
@param {Object} The object with SMART attribute revision and table.
Parse the SMART attribute table