Added /media exclusion and more dynamic tagging
This commit is contained in:
@ -49,13 +49,15 @@ class SystemHealthMonitor:
|
|||||||
'CEPH': '10.10.90.1',
|
'CEPH': '10.10.90.1',
|
||||||
'PING_TIMEOUT': 1,
|
'PING_TIMEOUT': 1,
|
||||||
'PING_COUNT': 1
|
'PING_COUNT': 1
|
||||||
}
|
},
|
||||||
|
'EXCLUDED_MOUNTS': ['/media']
|
||||||
}
|
}
|
||||||
TICKET_TEMPLATES = {
|
TICKET_TEMPLATES = {
|
||||||
'ACTION_TYPE': '[auto]',
|
'ACTION_TYPE': '[auto]',
|
||||||
'ENVIRONMENT': '[production]',
|
'ENVIRONMENT': '[production]',
|
||||||
'TICKET_TYPE': '[maintenance]',
|
'TICKET_TYPE': '[maintenance]',
|
||||||
'HARDWARE_TYPE': '[hardware]',
|
'HARDWARE_TYPE': '[hardware]',
|
||||||
|
'SOFTWARE_TYPE': '[software]'
|
||||||
'NETWORK_TYPE': '[network]',
|
'NETWORK_TYPE': '[network]',
|
||||||
'SCOPE_SINGLE': '[single-node]',
|
'SCOPE_SINGLE': '[single-node]',
|
||||||
'SCOPE_CLUSTER': '[cluster-wide]',
|
'SCOPE_CLUSTER': '[cluster-wide]',
|
||||||
@ -614,7 +616,17 @@ class SystemHealthMonitor:
|
|||||||
if drive_details['capacity']:
|
if drive_details['capacity']:
|
||||||
drive_size = f"[{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)
|
description = self._generate_detailed_description(issue, health_report)
|
||||||
|
|
||||||
ticket_payload = {
|
ticket_payload = {
|
||||||
@ -1331,6 +1343,9 @@ class SystemHealthMonitor:
|
|||||||
try:
|
try:
|
||||||
parts = fs_line.split()
|
parts = fs_line.split()
|
||||||
if len(parts) >= 6:
|
if len(parts) >= 6:
|
||||||
|
if parts[5] in self.CONFIG['EXCLUDED_MOUNTS']:
|
||||||
|
continue
|
||||||
|
|
||||||
# Convert size strings to comparable values
|
# Convert size strings to comparable values
|
||||||
total = parts[2]
|
total = parts[2]
|
||||||
used = parts[3]
|
used = parts[3]
|
||||||
|
|||||||
Reference in New Issue
Block a user