fs init better and better logs

This commit is contained in:
2025-03-09 20:13:56 -04:00
parent 7f0adb178c
commit d426557693

View File

@ -1375,11 +1375,11 @@ class SystemHealthMonitor:
if len(parts) >= 6:
usage_percent = 0
filesystem = {
'mountpoint': '',
'total': '',
'used': '',
'available': '',
'usage_percent': 0
'mountpoint': parts[5], # Last column is the mountpoint
'total': parts[2], # Size column
'used': parts[3], # Used column
'available': parts[4], # Avail column
'usage_percent': float(parts[4].rstrip('%')) # Use% column
}
if parts[0].startswith('appPool:'):
@ -1398,18 +1398,13 @@ class SystemHealthMonitor:
used_size = self._convert_size_to_bytes(parts[2])
usage_percent = float(parts[4].rstrip('%'))
logger.debug(f"Storage metrics for {mountpoint}:")
logger.debug(f" Total: {parts[1]}")
logger.debug(f" Used: {parts[2]}")
logger.debug(f"Storage metrics parsed for LXC {vmid}:")
logger.debug(f" Filesystem: {parts[0]}")
logger.debug(f" Total: {filesystem['total']}")
logger.debug(f" Used: {filesystem['used']}")
logger.debug(f" Available: {filesystem['available']}")
logger.debug(f" Usage: {usage_percent}%")
filesystem.update({
'mountpoint': parts[5] if len(parts) >= 6 else '',
'total': parts[1],
'used': parts[2],
'available': parts[3],
'usage_percent': float(parts[4].rstrip('%'))
})
logger.debug(f" Mountpoint: {filesystem['mountpoint']}")
if usage_percent >= self.CONFIG['THRESHOLDS']['DISK_CRITICAL']:
logger.debug(f"CRITICAL: Storage usage {usage_percent}% exceeds critical threshold")