i dont even know broski

This commit is contained in:
2025-03-09 18:35:55 -04:00
parent 3ca3b58bbd
commit 9bafa3249a

View File

@ -646,12 +646,12 @@ class SystemHealthMonitor:
ticket_title = (
f"[{hostname}]"
f"{self.TICKET_TEMPLATES['ACTION_TYPE']['AUTO']}"
f"{action_type['AUTO']}"
f"{self.TICKET_TEMPLATES[f'{issue_type}_TYPE'][issue_type]}"
f"{issue}"
f"{self.TICKET_TEMPLATES['SCOPE']['SINGLE_NODE']}"
f"{self.TICKET_TEMPLATES['ENVIRONMENT']['PRODUCTION']}"
f"{self.TICKET_TEMPLATES['TICKET_TYPE']['MAINTENANCE']}"
f"{scope['SINGLE_NODE']}"
f"{environment['PRODUCTION']}"
f"{ticket_type['MAINTENANCE']}"
)
description = self._generate_detailed_description(issue, health_report)
@ -1381,41 +1381,21 @@ class SystemHealthMonitor:
try:
parts = fs_line.split()
if len(parts) >= 6:
mountpoint = parts[5] # Get the Path column
logger.debug(parts[1])
usage_percent = float(parts[4].rstrip('%')) # Get the Use% column
# Check exclusion patterns
if any(re.match(pattern, mountpoint) for pattern in self.CONFIG['EXCLUDED_PATTERNS']):
logger.debug(f"Excluded mountpoint: {mountpoint}")
continue
if len(parts) >= 6:
mountpoint = parts[6]
usage_percent = int(float(parts[4].rstrip('%')))
logger.debug(f"=== Starting Path Exclusion Check ===")
logger.debug(f"Path to check: {mountpoint}")
logger.debug(f"Configured patterns: {self.CONFIG['EXCLUDED_PATTERNS']}")
for pattern in self.CONFIG['EXCLUDED_PATTERNS']:
match = re.match(pattern, mountpoint)
logger.debug(f"Pattern: {pattern}")
logger.debug(f" └─ Match result: {bool(match)}")
logger.debug(f" └─ Raw match data: {match if match else 'None'}")
if any(re.match(pattern, mountpoint) for pattern in self.CONFIG['EXCLUDED_PATTERNS']):
logger.debug(f"EXCLUDED: {mountpoint} matched one or more patterns")
continue
# Convert size strings to comparable values
total = parts[2]
used = parts[3]
avail = parts[4]
# Calculate usage percentage
total_bytes = self._convert_size_to_bytes(total)
used_bytes = self._convert_size_to_bytes(used)
usage_percent = int((used_bytes / total_bytes) * 100)
filesystem = {
'mountpoint': parts[5],
'total': total,
'used': used,
'available': avail,
'mountpoint': mountpoint,
'total': parts[2],
'used': parts[3],
'available': parts[4],
'usage_percent': usage_percent
}