Add support for add extra commands to smartctl
Add extra commands on a drive by drive basis for smartctl
This commit is contained in:
@@ -358,7 +358,8 @@ class MonitorWindow(QMainWindow):
|
|||||||
try:
|
try:
|
||||||
for _drive in self.multiDrive.drives:
|
for _drive in self.multiDrive.drives:
|
||||||
if not _drive in self.driveTempFilter:
|
if not _drive in self.driveTempFilter:
|
||||||
temperatures.append( self.multiDrive.driveTemp( _drive ) )
|
extraCmd = self.config.getValue( 'smartctl', _drive, None )
|
||||||
|
temperatures.append( self.multiDrive.driveTemp( _drive, extraCmd ))
|
||||||
except Exception:
|
except Exception:
|
||||||
temperatures = [ 0.0 for _ in self.multiDrive.drives ]
|
temperatures = [ 0.0 for _ in self.multiDrive.drives ]
|
||||||
|
|
||||||
|
|||||||
@@ -167,9 +167,13 @@ class multiDriveStat():
|
|||||||
except:
|
except:
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
def driveTemp(self,_drive) -> float:
|
def driveTemp(self,_drive:str, extracmd = None) -> float:
|
||||||
smartOutRaw = ""
|
smartOutRaw = ""
|
||||||
|
if extracmd is None:
|
||||||
cmd = f'sudo smartctl -A /dev/{_drive}'
|
cmd = f'sudo smartctl -A /dev/{_drive}'
|
||||||
|
else:
|
||||||
|
cmd = f'sudo smartctl {extracmd} -a /dev/{_drive}'
|
||||||
|
|
||||||
try:
|
try:
|
||||||
command = os.popen( cmd )
|
command = os.popen( cmd )
|
||||||
smartOutRaw = command.read()
|
smartOutRaw = command.read()
|
||||||
@@ -219,7 +223,7 @@ class multiDriveStat():
|
|||||||
|
|
||||||
class CPUInfo:
|
class CPUInfo:
|
||||||
'''
|
'''
|
||||||
This class deals with getting data about a Raspberry PI CPU
|
This class deals with getting data about a Raspberry PI 5 CPU fan.
|
||||||
|
|
||||||
'''
|
'''
|
||||||
def __init__( self ):
|
def __init__( self ):
|
||||||
|
|||||||
Reference in New Issue
Block a user