i dont even know broski
This commit is contained in:
@ -646,12 +646,12 @@ class SystemHealthMonitor:
|
|||||||
|
|
||||||
ticket_title = (
|
ticket_title = (
|
||||||
f"[{hostname}]"
|
f"[{hostname}]"
|
||||||
f"{self.TICKET_TEMPLATES['ACTION_TYPE']['AUTO']}"
|
f"{action_type['AUTO']}"
|
||||||
f"{self.TICKET_TEMPLATES[f'{issue_type}_TYPE'][issue_type]} "
|
f"{self.TICKET_TEMPLATES[f'{issue_type}_TYPE'][issue_type]}"
|
||||||
f"{issue} "
|
f"{issue}"
|
||||||
f"{self.TICKET_TEMPLATES['SCOPE']['SINGLE_NODE']}"
|
f"{scope['SINGLE_NODE']}"
|
||||||
f"{self.TICKET_TEMPLATES['ENVIRONMENT']['PRODUCTION']}"
|
f"{environment['PRODUCTION']}"
|
||||||
f"{self.TICKET_TEMPLATES['TICKET_TYPE']['MAINTENANCE']}"
|
f"{ticket_type['MAINTENANCE']}"
|
||||||
)
|
)
|
||||||
description = self._generate_detailed_description(issue, health_report)
|
description = self._generate_detailed_description(issue, health_report)
|
||||||
|
|
||||||
@ -1381,41 +1381,21 @@ class SystemHealthMonitor:
|
|||||||
try:
|
try:
|
||||||
parts = fs_line.split()
|
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']):
|
if any(re.match(pattern, mountpoint) for pattern in self.CONFIG['EXCLUDED_PATTERNS']):
|
||||||
logger.debug(f"Excluded mountpoint: {mountpoint}")
|
logger.debug(f"Excluded mountpoint: {mountpoint}")
|
||||||
continue
|
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 = {
|
filesystem = {
|
||||||
'mountpoint': parts[5],
|
'mountpoint': mountpoint,
|
||||||
'total': total,
|
'total': parts[2],
|
||||||
'used': used,
|
'used': parts[3],
|
||||||
'available': avail,
|
'available': parts[4],
|
||||||
'usage_percent': usage_percent
|
'usage_percent': usage_percent
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user