diff --git a/hwmonDaemon.py b/hwmonDaemon.py index fe2afc5..6483196 100644 --- a/hwmonDaemon.py +++ b/hwmonDaemon.py @@ -774,6 +774,57 @@ class SystemHealthMonitor: return description + def _determine_ticket_priority(self, issue: str, health_report: Dict[str, Any]) -> str: + """ + Determine ticket priority based on issue type and severity. + P1 = Critical system outages (reserved for future major outages) + P2 = Hardware failures requiring same-day response + P3 = Warnings requiring response within 1-3 days + P4 = Low priority monitoring alerts + """ + + issue_lower = issue.lower() + + # P1 - Reserved for major system outages (implement later) + # if 'cluster down' in issue_lower or 'total failure' in issue_lower: + # return self.PRIORITIES['CRITICAL'] # P1 + + # P2 - Hardware failures requiring same-day response + if any(keyword in issue_lower for keyword in [ + 'smart failure', 'drive failure', 'disk failure', + 'uncorrectable ecc', 'hardware failure', + 'critical temperature', 'firmware issue', + 'reallocated sector', 'pending sector' + ]): + return self.PRIORITIES['HIGH'] # P2 + + # P2 - SMART errors indicating potential drive failure + if 'smart issues' in issue_lower and any(error_type in issue_lower for error_type in [ + 'error', 'failed', 'reallocated', 'pending', 'uncorrectable' + ]): + return self.PRIORITIES['HIGH'] # P2 + + # P2 - Critical storage usage (>90%) + if 'critical storage usage' in issue_lower: + return self.PRIORITIES['HIGH'] # P2 + + # P2 - Network failures affecting cluster communication + if any(keyword in issue_lower for keyword in [ + 'network failure', 'unreachable', 'network down' + ]): + return self.PRIORITIES['HIGH'] # P2 + + # P3 - Warnings requiring attention within days + if any(keyword in issue_lower for keyword in [ + 'high temperature', 'high storage usage', + 'correctable ecc', 'high cpu usage', + 'warning' + ]): + return self.PRIORITIES['MEDIUM'] # P3 + + # P4 - Low priority monitoring alerts + return self.PRIORITIES['LOW'] # P4 + def _create_tickets_for_issues(self, health_report: Dict[str, Any]): issues = self._detect_issues(health_report) if not issues: