Add support for a configuration file.

Adding a coniguration file (/etc/sysmon.ini).  This will allow users to
no monitor the temperature of speciic drives by ignoring them, as well
as ignoring the performance from specific drives.

For instance on a system running mdraid, you could ignore performance on
all of the drives that make up the raid array, and ignore the
temperature of the raid device.
This commit is contained in:
Jeff Curless
2025-11-02 16:10:22 -05:00
parent 927f00f655
commit a1ac933238
4 changed files with 129 additions and 23 deletions

View File

@@ -124,14 +124,18 @@ class multiDriveStat():
If there is a missing drive from the filter, that drive is eliminated.
'''
def __init__(self):
def __init__(self,driveIgnoreList : list[str]=[]):
#
# Get all drives
#
self._drives = []
with os.popen( 'ls -1 /sys/block | grep -v -e loop -e ram') as command:
lsblk_raw = command.read()
self._drives = [ l for l in lsblk_raw.split('\n') if l]
for l in lsblk_raw.split('\n'):
if len(l) == 0:
continue
if not l in driveIgnoreList:
self._drives.append( l )
self._stats = [ DriveStats(_) for _ in self._drives ]
@property