Updated indexcies
This commit is contained in:
@ -1443,9 +1443,10 @@ class SystemHealthMonitor:
|
||||
continue
|
||||
|
||||
logger.debug(f"Processing filesystem line: {fs_line}")
|
||||
parts = fs_line.split()
|
||||
#parts = fs_line.split()
|
||||
columns = line.split()
|
||||
logger.debug(f"Split parts: {parts}")
|
||||
if len(parts) >= 6:
|
||||
if len(columns) >= 6:
|
||||
try:
|
||||
# Skip excluded mounts
|
||||
if parts[0].startswith('appPool:') or '/mnt/pve/mediaf' in parts[0]:
|
||||
@ -1454,7 +1455,7 @@ class SystemHealthMonitor:
|
||||
# Get the mountpoint (last column)
|
||||
if len(parts) > 5:
|
||||
# The mountpoint is the last column
|
||||
mountpoint = parts[-1]
|
||||
mountpoint = columns[-1]
|
||||
else:
|
||||
mountpoint = "/"
|
||||
|
||||
@ -1464,13 +1465,13 @@ class SystemHealthMonitor:
|
||||
continue
|
||||
|
||||
# Parse size values safely
|
||||
total_space = self._parse_size(parts[1])
|
||||
used_space = self._parse_size(parts[2])
|
||||
available_space = self._parse_size(parts[3])
|
||||
total_space = self._parse_size(columns[-5])
|
||||
used_space = self._parse_size(columns[-4])
|
||||
available_space = self._parse_size(columns[-3])
|
||||
|
||||
# Parse percentage safely
|
||||
try:
|
||||
usage_percent = float(parts[4].rstrip('%'))
|
||||
usage_percent = float(columns[-2].rstrip('%'))
|
||||
except (ValueError, IndexError):
|
||||
# Calculate percentage if parsing fails
|
||||
usage_percent = (used_space / total_space * 100) if total_space > 0 else 0
|
||||
|
||||
Reference in New Issue
Block a user