fs init better and better logs
This commit is contained in:
@ -1375,11 +1375,11 @@ class SystemHealthMonitor:
|
|||||||
if len(parts) >= 6:
|
if len(parts) >= 6:
|
||||||
usage_percent = 0
|
usage_percent = 0
|
||||||
filesystem = {
|
filesystem = {
|
||||||
'mountpoint': '',
|
'mountpoint': parts[5], # Last column is the mountpoint
|
||||||
'total': '',
|
'total': parts[2], # Size column
|
||||||
'used': '',
|
'used': parts[3], # Used column
|
||||||
'available': '',
|
'available': parts[4], # Avail column
|
||||||
'usage_percent': 0
|
'usage_percent': float(parts[4].rstrip('%')) # Use% column
|
||||||
}
|
}
|
||||||
|
|
||||||
if parts[0].startswith('appPool:'):
|
if parts[0].startswith('appPool:'):
|
||||||
@ -1398,18 +1398,13 @@ class SystemHealthMonitor:
|
|||||||
used_size = self._convert_size_to_bytes(parts[2])
|
used_size = self._convert_size_to_bytes(parts[2])
|
||||||
usage_percent = float(parts[4].rstrip('%'))
|
usage_percent = float(parts[4].rstrip('%'))
|
||||||
|
|
||||||
logger.debug(f"Storage metrics for {mountpoint}:")
|
logger.debug(f"Storage metrics parsed for LXC {vmid}:")
|
||||||
logger.debug(f" Total: {parts[1]}")
|
logger.debug(f" Filesystem: {parts[0]}")
|
||||||
logger.debug(f" Used: {parts[2]}")
|
logger.debug(f" Total: {filesystem['total']}")
|
||||||
|
logger.debug(f" Used: {filesystem['used']}")
|
||||||
|
logger.debug(f" Available: {filesystem['available']}")
|
||||||
logger.debug(f" Usage: {usage_percent}%")
|
logger.debug(f" Usage: {usage_percent}%")
|
||||||
|
logger.debug(f" Mountpoint: {filesystem['mountpoint']}")
|
||||||
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('%'))
|
|
||||||
})
|
|
||||||
|
|
||||||
if usage_percent >= self.CONFIG['THRESHOLDS']['DISK_CRITICAL']:
|
if usage_percent >= self.CONFIG['THRESHOLDS']['DISK_CRITICAL']:
|
||||||
logger.debug(f"CRITICAL: Storage usage {usage_percent}% exceeds critical threshold")
|
logger.debug(f"CRITICAL: Storage usage {usage_percent}% exceeds critical threshold")
|
||||||
|
|||||||
Reference in New Issue
Block a user