Added ticket summary

This commit is contained in:
2025-03-04 20:31:29 -05:00
parent 5659c0c293
commit e3e0c73630

View File

@ -32,7 +32,7 @@ class SystemHealthMonitor:
'DISK_WARNING': PRIORITIES['MEDIUM'],
'UNCORRECTABLE_ECC': PRIORITIES['HIGH'],
'CORRECTABLE_ECC': PRIORITIES['MEDIUM'],
'CPU_HIGH': PRIORITIES['MEDIUM'],
'CPU_HIGH': PRIORITIES['LOW'],
'NETWORK_FAILURE': PRIORITIES['HIGH']
}
CONFIG = {
@ -46,7 +46,7 @@ class SystemHealthMonitor:
'NETWORKS': {
'MANAGEMENT': '10.10.10.1',
'CEPH': '10.10.90.1',
'PING_TIMEOUT': 1, # seconds
'PING_TIMEOUT': 1,
'PING_COUNT': 1
}
}
@ -382,6 +382,39 @@ class SystemHealthMonitor:
3. Check workload distribution
"""
}
SEVERITY_INDICATORS = {
'CRITICAL': '🔴',
'WARNING': '🟡',
'HEALTHY': '🟢',
'UNKNOWN': ''
}
def _get_issue_type(self, issue: str) -> str:
if "SMART" in issue:
return "SMART Health Issue"
elif "Drive" in issue:
return "Storage Issue"
elif "ECC" in issue:
return "Memory Issue"
elif "CPU" in issue:
return "Performance Issue"
elif "Network" in issue:
return "Network Issue"
return "Hardware Issue"
def _get_impact_level(self, issue: str) -> str:
if "CRITICAL" in issue or "UNHEALTHY" in issue:
return "🔴 Critical - Immediate Action Required"
elif "WARNING" in issue:
return "🟡 Warning - Action Needed Soon"
return "🟢 Low - Monitor Only"
executive_summary = f"""
┏━ EXECUTIVE SUMMARY ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Issue Type │ {self._get_issue_type(issue)}
┃ Impact Level │ {self._get_impact_level(issue)}
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
"""
# Add relevant SMART descriptions
for attr in SMART_DESCRIPTIONS: