Sofware failure not hardware

This commit is contained in:
2025-05-12 16:12:46 -04:00
parent 1f52a6b4f5
commit 0384270dfc

View File

@ -636,6 +636,7 @@ class SystemHealthMonitor:
environment = self.TICKET_TEMPLATES['ENVIRONMENT'] environment = self.TICKET_TEMPLATES['ENVIRONMENT']
ticket_type = self.TICKET_TEMPLATES['TICKET_TYPE'] ticket_type = self.TICKET_TEMPLATES['TICKET_TYPE']
hardware_type = self.TICKET_TEMPLATES['HARDWARE_TYPE'] hardware_type = self.TICKET_TEMPLATES['HARDWARE_TYPE']
software_type = self.TICKET_TEMPLATES['SOFTWARE_TYPE']
for issue in issues: for issue in issues:
priority = self.PRIORITIES['MEDIUM'] priority = self.PRIORITIES['MEDIUM']
@ -644,18 +645,22 @@ class SystemHealthMonitor:
scope = self.TICKET_TEMPLATES['SCOPE']['SINGLE_NODE'] scope = self.TICKET_TEMPLATES['SCOPE']['SINGLE_NODE']
drive_size = "" drive_size = ""
if "Drive" in issue: if "Drive" in issue and "/dev/" in issue:
device = re.search(r'/dev/[a-zA-Z0-9]+', issue).group(0) device = re.search(r'/dev/[a-zA-Z0-9]+', issue).group(0)
drive_details = self._get_drive_details(device) drive_details = self._get_drive_details(device)
if drive_details['capacity']: if drive_details['capacity']:
drive_size = f"[{drive_details['capacity']}] " drive_size = f"[{drive_details['capacity']}] "
# Determine if this is a hardware or software issue
issue_category = 'SOFTWARE' if 'LXC' in issue else 'HARDWARE' issue_category = 'SOFTWARE' if 'LXC' in issue else 'HARDWARE'
# Use the correct template based on issue category
category_template = hardware_type['HARDWARE'] if issue_category == 'HARDWARE' else software_type['SOFTWARE']
ticket_title = ( ticket_title = (
f"[{hostname}]" f"[{hostname}]"
f"{action_type['AUTO']}" f"{action_type['AUTO']}"
f"{self.TICKET_TEMPLATES[f'{issue_category}_TYPE'][issue_category]}" f"{category_template}"
f"{issue}" f"{issue}"
f"{scope['SINGLE_NODE']}" f"{scope['SINGLE_NODE']}"
f"{environment['PRODUCTION']}" f"{environment['PRODUCTION']}"