From 0384270dfce517e82666723704c78e8420ea0e2f Mon Sep 17 00:00:00 2001 From: Jared Vititoe Date: Mon, 12 May 2025 16:12:46 -0400 Subject: [PATCH] Sofware failure not hardware --- hwmonDaemon.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/hwmonDaemon.py b/hwmonDaemon.py index 428f244..0df448c 100644 --- a/hwmonDaemon.py +++ b/hwmonDaemon.py @@ -636,6 +636,7 @@ class SystemHealthMonitor: environment = self.TICKET_TEMPLATES['ENVIRONMENT'] ticket_type = self.TICKET_TEMPLATES['TICKET_TYPE'] hardware_type = self.TICKET_TEMPLATES['HARDWARE_TYPE'] + software_type = self.TICKET_TEMPLATES['SOFTWARE_TYPE'] for issue in issues: priority = self.PRIORITIES['MEDIUM'] @@ -644,18 +645,22 @@ class SystemHealthMonitor: scope = self.TICKET_TEMPLATES['SCOPE']['SINGLE_NODE'] 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) drive_details = self._get_drive_details(device) if 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' + + # Use the correct template based on issue category + category_template = hardware_type['HARDWARE'] if issue_category == 'HARDWARE' else software_type['SOFTWARE'] ticket_title = ( f"[{hostname}]" f"{action_type['AUTO']}" - f"{self.TICKET_TEMPLATES[f'{issue_category}_TYPE'][issue_category]}" + f"{category_template}" f"{issue}" f"{scope['SINGLE_NODE']}" f"{environment['PRODUCTION']}"