Better appPool check
This commit is contained in:
@ -1368,7 +1368,15 @@ class SystemHealthMonitor:
|
|||||||
try:
|
try:
|
||||||
parts = fs_line.split()
|
parts = fs_line.split()
|
||||||
if len(parts) >= 6:
|
if len(parts) >= 6:
|
||||||
mountpoint = parts[5] # Get the Path column
|
# Skip pool name entries that start with 'appPool:'
|
||||||
|
if parts[0].startswith('appPool:'):
|
||||||
|
continue
|
||||||
|
|
||||||
|
# Skip mediafs mount entries
|
||||||
|
if '/mnt/pve/mediaf' in parts[0]:
|
||||||
|
continue
|
||||||
|
|
||||||
|
mountpoint = parts[5]
|
||||||
|
|
||||||
# Skip excluded mountpoints
|
# Skip excluded mountpoints
|
||||||
if any(pattern in mountpoint for pattern in ['/media', '/mnt/pve/mediafs', '/opt/metube_downloads']):
|
if any(pattern in mountpoint for pattern in ['/media', '/mnt/pve/mediafs', '/opt/metube_downloads']):
|
||||||
@ -1376,16 +1384,18 @@ class SystemHealthMonitor:
|
|||||||
logger.debug(f"Skipping excluded mountpoint: {mountpoint}")
|
logger.debug(f"Skipping excluded mountpoint: {mountpoint}")
|
||||||
continue
|
continue
|
||||||
|
|
||||||
size_value = self._convert_size_to_bytes(parts[1]) # For total size
|
if parts[1][-1] in 'BKMGT' and parts[2][-1] in 'BKMGT':
|
||||||
used_value = self._convert_size_to_bytes(parts[2]) # For used size
|
total_size = self._convert_size_to_bytes(parts[1])
|
||||||
usage_percent = (used_size / total_size) * 100 if total_size > 0 else 0
|
used_size = self._convert_size_to_bytes(parts[2])
|
||||||
filesystem = {
|
usage_percent = float(parts[4].rstrip('%'))
|
||||||
'mountpoint': mountpoint,
|
|
||||||
'total': parts[1],
|
filesystem = {
|
||||||
'used': parts[2],
|
'mountpoint': mountpoint,
|
||||||
'available': parts[3],
|
'total': parts[1],
|
||||||
'usage_percent': usage_percent
|
'used': parts[2],
|
||||||
}
|
'available': parts[3],
|
||||||
|
'usage_percent': usage_percent
|
||||||
|
}
|
||||||
|
|
||||||
if usage_percent >= self.CONFIG['THRESHOLDS']['DISK_CRITICAL']:
|
if usage_percent >= self.CONFIG['THRESHOLDS']['DISK_CRITICAL']:
|
||||||
lxc_health['status'] = 'CRITICAL'
|
lxc_health['status'] = 'CRITICAL'
|
||||||
|
|||||||
Reference in New Issue
Block a user