From 40b7eb56416dbbd4314f6d53766d165e687d67c7 Mon Sep 17 00:00:00 2001 From: Jared Vititoe Date: Wed, 14 May 2025 21:17:52 -0400 Subject: [PATCH] Updated indexcies --- hwmonDaemon.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/hwmonDaemon.py b/hwmonDaemon.py index 4cdc419..aaba83a 100644 --- a/hwmonDaemon.py +++ b/hwmonDaemon.py @@ -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