Added /media exclusion and more dynamic tagging

This commit is contained in:
2025-03-09 17:04:50 -04:00
parent a4cdbdce70
commit 3aec25d967

View File

@ -49,13 +49,15 @@ class SystemHealthMonitor:
'CEPH': '10.10.90.1',
'PING_TIMEOUT': 1,
'PING_COUNT': 1
}
},
'EXCLUDED_MOUNTS': ['/media']
}
TICKET_TEMPLATES = {
'ACTION_TYPE': '[auto]',
'ENVIRONMENT': '[production]',
'TICKET_TYPE': '[maintenance]',
'HARDWARE_TYPE': '[hardware]',
'SOFTWARE_TYPE': '[software]'
'NETWORK_TYPE': '[network]',
'SCOPE_SINGLE': '[single-node]',
'SCOPE_CLUSTER': '[cluster-wide]',
@ -614,7 +616,17 @@ class SystemHealthMonitor:
if drive_details['capacity']:
drive_size = f"[{drive_details['capacity']}] "
ticket_title = f"[{hostname}] {action_type} {hardware_type} {drive_size}{issue} {scope} {environment} {ticket_type}"
issue_type = 'SOFTWARE' if 'LXC' in issue else 'HARDWARE'
ticket_title = (
f"[{hostname}]"
f"[{self.TICKET_TEMPLATES['ACTION_TYPE']['AUTO']}]"
f"[{self.TICKET_TEMPLATES['ISSUE_TYPE'][issue_type]}] "
f"{issue} "
f"[{self.TICKET_TEMPLATES['SCOPE']['SINGLE_NODE']}]"
f"[{self.TICKET_TEMPLATES['ENVIRONMENT']['PRODUCTION']}]"
f"[{self.TICKET_TEMPLATES['TYPE']['MAINTENANCE']}]"
)
description = self._generate_detailed_description(issue, health_report)
ticket_payload = {
@ -1331,6 +1343,9 @@ class SystemHealthMonitor:
try:
parts = fs_line.split()
if len(parts) >= 6:
if parts[5] in self.CONFIG['EXCLUDED_MOUNTS']:
continue
# Convert size strings to comparable values
total = parts[2]
used = parts[3]