Updated indexcies

This commit is contained in:
2025-05-14 21:17:52 -04:00
parent 6fb0d89519
commit 40b7eb5641

View File

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