'-1 = No SMART
0  = DISK FAILING
1  = PRE-FAIL
2  = Unknown error
3  = Errors in log
4  = DISK OK'

def measure(self, path):

    if (not path):
        return (-1)
    r = subprocess.call(['smartctl', '-H', ('/dev/' + path)])
    if (r & 2):
        return (-1)
    if (r & 8):
        return 0
    if (r & 16):
        return 1
    if (r & 64):
        return 3
    if (r == 0):
        return 4
    return 2
