mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2026-04-27 21:50:39 +00:00
Update notification_templates.py
This commit is contained in:
@@ -381,106 +381,106 @@ TEMPLATES = {
|
|||||||
|
|
||||||
# ── VM / CT events ──
|
# ── VM / CT events ──
|
||||||
'vm_start': {
|
'vm_start': {
|
||||||
'title': '{hostname}: VM {vmid} started',
|
'title': '{hostname}: VM {vmname} ({vmid}) started',
|
||||||
'body': '{vmname} ({vmid}) has been started.',
|
'body': 'Virtual machine {vmname} (ID: {vmid}) is now running.',
|
||||||
'label': 'VM started',
|
'label': 'VM started',
|
||||||
'group': 'vm_ct',
|
'group': 'vm_ct',
|
||||||
'default_enabled': True,
|
'default_enabled': True,
|
||||||
},
|
},
|
||||||
'vm_stop': {
|
'vm_stop': {
|
||||||
'title': '{hostname}: VM {vmid} stopped',
|
'title': '{hostname}: VM {vmname} ({vmid}) stopped',
|
||||||
'body': '{vmname} ({vmid}) has been stopped.',
|
'body': 'Virtual machine {vmname} (ID: {vmid}) has been stopped.',
|
||||||
'label': 'VM stopped',
|
'label': 'VM stopped',
|
||||||
'group': 'vm_ct',
|
'group': 'vm_ct',
|
||||||
'default_enabled': False,
|
'default_enabled': False,
|
||||||
},
|
},
|
||||||
'vm_shutdown': {
|
'vm_shutdown': {
|
||||||
'title': '{hostname}: VM {vmid} shutdown',
|
'title': '{hostname}: VM {vmname} ({vmid}) shut down',
|
||||||
'body': '{vmname} ({vmid}) has been shut down.',
|
'body': 'Virtual machine {vmname} (ID: {vmid}) has been cleanly shut down.',
|
||||||
'label': 'VM shutdown',
|
'label': 'VM shutdown',
|
||||||
'group': 'vm_ct',
|
'group': 'vm_ct',
|
||||||
'default_enabled': False,
|
'default_enabled': False,
|
||||||
},
|
},
|
||||||
'vm_fail': {
|
'vm_fail': {
|
||||||
'title': '{hostname}: VM {vmid} FAILED',
|
'title': '{hostname}: VM {vmname} ({vmid}) FAILED',
|
||||||
'body': '{vmname} ({vmid}) has failed.\n{reason}',
|
'body': 'Virtual machine {vmname} (ID: {vmid}) has crashed or failed to start.\nReason: {reason}',
|
||||||
'label': 'VM FAILED',
|
'label': 'VM FAILED',
|
||||||
'group': 'vm_ct',
|
'group': 'vm_ct',
|
||||||
'default_enabled': True,
|
'default_enabled': True,
|
||||||
},
|
},
|
||||||
'vm_restart': {
|
'vm_restart': {
|
||||||
'title': '{hostname}: VM {vmid} restarted',
|
'title': '{hostname}: VM {vmname} ({vmid}) restarted',
|
||||||
'body': '{vmname} ({vmid}) has been restarted.',
|
'body': 'Virtual machine {vmname} (ID: {vmid}) has been restarted.',
|
||||||
'label': 'VM restarted',
|
'label': 'VM restarted',
|
||||||
'group': 'vm_ct',
|
'group': 'vm_ct',
|
||||||
'default_enabled': False,
|
'default_enabled': False,
|
||||||
},
|
},
|
||||||
'ct_start': {
|
'ct_start': {
|
||||||
'title': '{hostname}: CT {vmid} started',
|
'title': '{hostname}: CT {vmname} ({vmid}) started',
|
||||||
'body': '{vmname} ({vmid}) has been started.',
|
'body': 'Container {vmname} (ID: {vmid}) is now running.',
|
||||||
'label': 'CT started',
|
'label': 'CT started',
|
||||||
'group': 'vm_ct',
|
'group': 'vm_ct',
|
||||||
'default_enabled': True,
|
'default_enabled': True,
|
||||||
},
|
},
|
||||||
'ct_stop': {
|
'ct_stop': {
|
||||||
'title': '{hostname}: CT {vmid} stopped',
|
'title': '{hostname}: CT {vmname} ({vmid}) stopped',
|
||||||
'body': '{vmname} ({vmid}) has been stopped.',
|
'body': 'Container {vmname} (ID: {vmid}) has been stopped.',
|
||||||
'label': 'CT stopped',
|
'label': 'CT stopped',
|
||||||
'group': 'vm_ct',
|
'group': 'vm_ct',
|
||||||
'default_enabled': False,
|
'default_enabled': False,
|
||||||
},
|
},
|
||||||
'ct_shutdown': {
|
'ct_shutdown': {
|
||||||
'title': '{hostname}: CT {vmid} shutdown',
|
'title': '{hostname}: CT {vmname} ({vmid}) shut down',
|
||||||
'body': '{vmname} ({vmid}) has been shut down.',
|
'body': 'Container {vmname} (ID: {vmid}) has been cleanly shut down.',
|
||||||
'label': 'CT shutdown',
|
'label': 'CT shutdown',
|
||||||
'group': 'vm_ct',
|
'group': 'vm_ct',
|
||||||
'default_enabled': False,
|
'default_enabled': False,
|
||||||
},
|
},
|
||||||
'ct_restart': {
|
'ct_restart': {
|
||||||
'title': '{hostname}: CT {vmid} restarted',
|
'title': '{hostname}: CT {vmname} ({vmid}) restarted',
|
||||||
'body': '{vmname} ({vmid}) has been restarted.',
|
'body': 'Container {vmname} (ID: {vmid}) has been restarted.',
|
||||||
'label': 'CT restarted',
|
'label': 'CT restarted',
|
||||||
'group': 'vm_ct',
|
'group': 'vm_ct',
|
||||||
'default_enabled': False,
|
'default_enabled': False,
|
||||||
},
|
},
|
||||||
'ct_fail': {
|
'ct_fail': {
|
||||||
'title': '{hostname}: CT {vmid} FAILED',
|
'title': '{hostname}: CT {vmname} ({vmid}) FAILED',
|
||||||
'body': '{vmname} ({vmid}) has failed.\n{reason}',
|
'body': 'Container {vmname} (ID: {vmid}) has crashed or failed to start.\nReason: {reason}',
|
||||||
'label': 'CT FAILED',
|
'label': 'CT FAILED',
|
||||||
'group': 'vm_ct',
|
'group': 'vm_ct',
|
||||||
'default_enabled': True,
|
'default_enabled': True,
|
||||||
},
|
},
|
||||||
'migration_start': {
|
'migration_start': {
|
||||||
'title': '{hostname}: Migration started - {vmid}',
|
'title': '{hostname}: Migration started — {vmname} ({vmid})',
|
||||||
'body': '{vmname} ({vmid}) migration to {target_node} started.',
|
'body': 'Live migration of {vmname} (ID: {vmid}) to node {target_node} has started.',
|
||||||
'label': 'Migration started',
|
'label': 'Migration started',
|
||||||
'group': 'vm_ct',
|
'group': 'vm_ct',
|
||||||
'default_enabled': True,
|
'default_enabled': True,
|
||||||
},
|
},
|
||||||
'migration_complete': {
|
'migration_complete': {
|
||||||
'title': '{hostname}: Migration complete - {vmid}',
|
'title': '{hostname}: Migration complete — {vmname} ({vmid})',
|
||||||
'body': '{vmname} ({vmid}) migrated successfully to {target_node}.',
|
'body': '{vmname} (ID: {vmid}) successfully migrated to node {target_node}.',
|
||||||
'label': 'Migration complete',
|
'label': 'Migration complete',
|
||||||
'group': 'vm_ct',
|
'group': 'vm_ct',
|
||||||
'default_enabled': True,
|
'default_enabled': True,
|
||||||
},
|
},
|
||||||
'migration_fail': {
|
'migration_fail': {
|
||||||
'title': '{hostname}: Migration FAILED - {vmid}',
|
'title': '{hostname}: Migration FAILED — {vmname} ({vmid})',
|
||||||
'body': '{vmname} ({vmid}) migration to {target_node} failed.\n{reason}',
|
'body': 'Migration of {vmname} (ID: {vmid}) to node {target_node} failed.\nReason: {reason}',
|
||||||
'label': 'Migration FAILED',
|
'label': 'Migration FAILED',
|
||||||
'group': 'vm_ct',
|
'group': 'vm_ct',
|
||||||
'default_enabled': True,
|
'default_enabled': True,
|
||||||
},
|
},
|
||||||
'replication_fail': {
|
'replication_fail': {
|
||||||
'title': '{hostname}: Replication FAILED - {vmid}',
|
'title': '{hostname}: Replication FAILED — {vmname} ({vmid})',
|
||||||
'body': 'Replication of {vmname} ({vmid}) has failed.\n{reason}',
|
'body': 'Replication of {vmname} (ID: {vmid}) failed.\nReason: {reason}',
|
||||||
'label': 'Replication FAILED',
|
'label': 'Replication FAILED',
|
||||||
'group': 'vm_ct',
|
'group': 'vm_ct',
|
||||||
'default_enabled': True,
|
'default_enabled': True,
|
||||||
},
|
},
|
||||||
'replication_complete': {
|
'replication_complete': {
|
||||||
'title': '{hostname}: Replication complete - {vmid}',
|
'title': '{hostname}: Replication complete — {vmname} ({vmid})',
|
||||||
'body': 'Replication of {vmname} ({vmid}) completed successfully.',
|
'body': 'Replication of {vmname} (ID: {vmid}) completed successfully.',
|
||||||
'label': 'Replication complete',
|
'label': 'Replication complete',
|
||||||
'group': 'vm_ct',
|
'group': 'vm_ct',
|
||||||
'default_enabled': False,
|
'default_enabled': False,
|
||||||
@@ -488,36 +488,36 @@ TEMPLATES = {
|
|||||||
|
|
||||||
# ── Backup / Snapshot events ──
|
# ── Backup / Snapshot events ──
|
||||||
'backup_start': {
|
'backup_start': {
|
||||||
'title': '{hostname}: Backup started [{storage}]',
|
'title': '{hostname}: Backup started on {storage}',
|
||||||
'body': '{reason}',
|
'body': 'Backup job started on storage {storage}.\n{reason}',
|
||||||
'label': 'Backup started',
|
'label': 'Backup started',
|
||||||
'group': 'backup',
|
'group': 'backup',
|
||||||
'default_enabled': False,
|
'default_enabled': False,
|
||||||
},
|
},
|
||||||
'backup_complete': {
|
'backup_complete': {
|
||||||
'title': '{hostname}: Backup complete - {vmid}',
|
'title': '{hostname}: Backup complete — {vmname} ({vmid})',
|
||||||
'body': 'Backup of {vmname} ({vmid}) completed successfully.\nSize: {size}',
|
'body': 'Backup of {vmname} (ID: {vmid}) completed successfully.\nSize: {size}',
|
||||||
'label': 'Backup complete',
|
'label': 'Backup complete',
|
||||||
'group': 'backup',
|
'group': 'backup',
|
||||||
'default_enabled': True,
|
'default_enabled': True,
|
||||||
},
|
},
|
||||||
'backup_fail': {
|
'backup_fail': {
|
||||||
'title': '{hostname}: Backup FAILED - {vmid}',
|
'title': '{hostname}: Backup FAILED — {vmname} ({vmid})',
|
||||||
'body': 'Backup of {vmname} ({vmid}) has failed.\n{reason}',
|
'body': 'Backup of {vmname} (ID: {vmid}) failed.\nReason: {reason}',
|
||||||
'label': 'Backup FAILED',
|
'label': 'Backup FAILED',
|
||||||
'group': 'backup',
|
'group': 'backup',
|
||||||
'default_enabled': True,
|
'default_enabled': True,
|
||||||
},
|
},
|
||||||
'snapshot_complete': {
|
'snapshot_complete': {
|
||||||
'title': '{hostname}: Snapshot created - {vmid}',
|
'title': '{hostname}: Snapshot created — {vmname} ({vmid})',
|
||||||
'body': 'Snapshot of {vmname} ({vmid}) created: {snapshot_name}',
|
'body': 'Snapshot "{snapshot_name}" created for {vmname} (ID: {vmid}).',
|
||||||
'label': 'Snapshot created',
|
'label': 'Snapshot created',
|
||||||
'group': 'backup',
|
'group': 'backup',
|
||||||
'default_enabled': False,
|
'default_enabled': False,
|
||||||
},
|
},
|
||||||
'snapshot_fail': {
|
'snapshot_fail': {
|
||||||
'title': '{hostname}: Snapshot FAILED - {vmid}',
|
'title': '{hostname}: Snapshot FAILED — {vmname} ({vmid})',
|
||||||
'body': 'Snapshot of {vmname} ({vmid}) failed.\n{reason}',
|
'body': 'Snapshot creation for {vmname} (ID: {vmid}) failed.\nReason: {reason}',
|
||||||
'label': 'Snapshot FAILED',
|
'label': 'Snapshot FAILED',
|
||||||
'group': 'backup',
|
'group': 'backup',
|
||||||
'default_enabled': True,
|
'default_enabled': True,
|
||||||
@@ -525,50 +525,50 @@ TEMPLATES = {
|
|||||||
|
|
||||||
# ── Resource events (from Health Monitor) ──
|
# ── Resource events (from Health Monitor) ──
|
||||||
'cpu_high': {
|
'cpu_high': {
|
||||||
'title': '{hostname}: High CPU usage ({value}%)',
|
'title': '{hostname}: High CPU usage — {value}%',
|
||||||
'body': 'CPU usage is at {value}% on {cores} cores.\n{details}',
|
'body': 'CPU usage has reached {value}% on {cores} cores.\n{details}',
|
||||||
'label': 'High CPU usage',
|
'label': 'High CPU usage',
|
||||||
'group': 'resources',
|
'group': 'resources',
|
||||||
'default_enabled': True,
|
'default_enabled': True,
|
||||||
},
|
},
|
||||||
'ram_high': {
|
'ram_high': {
|
||||||
'title': '{hostname}: High memory usage ({value}%)',
|
'title': '{hostname}: High memory usage — {value}%',
|
||||||
'body': 'Memory usage: {used} / {total} ({value}%).\n{details}',
|
'body': 'Memory usage: {used} / {total} ({value}%).\n{details}',
|
||||||
'label': 'High memory usage',
|
'label': 'High memory usage',
|
||||||
'group': 'resources',
|
'group': 'resources',
|
||||||
'default_enabled': True,
|
'default_enabled': True,
|
||||||
},
|
},
|
||||||
'temp_high': {
|
'temp_high': {
|
||||||
'title': '{hostname}: High temperature ({value}C)',
|
'title': '{hostname}: High CPU temperature — {value}°C',
|
||||||
'body': 'CPU temperature: {value}C (threshold: {threshold}C).\n{details}',
|
'body': 'CPU temperature has reached {value}°C (threshold: {threshold}°C).\n{details}',
|
||||||
'label': 'High temperature',
|
'label': 'High temperature',
|
||||||
'group': 'resources',
|
'group': 'resources',
|
||||||
'default_enabled': True,
|
'default_enabled': True,
|
||||||
},
|
},
|
||||||
'disk_space_low': {
|
'disk_space_low': {
|
||||||
'title': '{hostname}: Low disk space on {mount}',
|
'title': '{hostname}: Low disk space on {mount}',
|
||||||
'body': '{mount}: {used}% used ({available} available).',
|
'body': 'Filesystem {mount}: {used}% used ({available} available).\nFree up disk space to avoid service disruption.',
|
||||||
'label': 'Low disk space',
|
'label': 'Low disk space',
|
||||||
'group': 'storage',
|
'group': 'storage',
|
||||||
'default_enabled': True,
|
'default_enabled': True,
|
||||||
},
|
},
|
||||||
'disk_io_error': {
|
'disk_io_error': {
|
||||||
'title': '{hostname}: Disk failure detected on {device}',
|
'title': '{hostname}: Disk failure detected — {device}',
|
||||||
'body': '{reason}',
|
'body': 'I/O error or disk failure detected on device {device}.\n{reason}',
|
||||||
'label': 'Disk failure / I/O error',
|
'label': 'Disk failure / I/O error',
|
||||||
'group': 'storage',
|
'group': 'storage',
|
||||||
'default_enabled': True,
|
'default_enabled': True,
|
||||||
},
|
},
|
||||||
'storage_unavailable': {
|
'storage_unavailable': {
|
||||||
'title': '{hostname}: Storage unavailable - {storage_name}',
|
'title': '{hostname}: Storage unavailable — {storage_name}',
|
||||||
'body': 'PVE storage "{storage_name}" ({storage_type}) is not available.\n{reason}',
|
'body': 'PVE storage "{storage_name}" (type: {storage_type}) is not accessible.\nReason: {reason}',
|
||||||
'label': 'Storage unavailable',
|
'label': 'Storage unavailable',
|
||||||
'group': 'storage',
|
'group': 'storage',
|
||||||
'default_enabled': True,
|
'default_enabled': True,
|
||||||
},
|
},
|
||||||
'load_high': {
|
'load_high': {
|
||||||
'title': '{hostname}: High system load ({value})',
|
'title': '{hostname}: High system load — {value}',
|
||||||
'body': 'System load average: {value} on {cores} cores.\n{details}',
|
'body': 'System load average is {value} on {cores} cores.\n{details}',
|
||||||
'label': 'High system load',
|
'label': 'High system load',
|
||||||
'group': 'resources',
|
'group': 'resources',
|
||||||
'default_enabled': True,
|
'default_enabled': True,
|
||||||
@@ -577,14 +577,14 @@ TEMPLATES = {
|
|||||||
# ── Network events ──
|
# ── Network events ──
|
||||||
'network_down': {
|
'network_down': {
|
||||||
'title': '{hostname}: Network connectivity lost',
|
'title': '{hostname}: Network connectivity lost',
|
||||||
'body': 'Network connectivity check failed.\n{reason}',
|
'body': 'The node has lost network connectivity.\nReason: {reason}',
|
||||||
'label': 'Network connectivity lost',
|
'label': 'Network connectivity lost',
|
||||||
'group': 'network',
|
'group': 'network',
|
||||||
'default_enabled': True,
|
'default_enabled': True,
|
||||||
},
|
},
|
||||||
'network_latency': {
|
'network_latency': {
|
||||||
'title': '{hostname}: High network latency ({value}ms)',
|
'title': '{hostname}: High network latency — {value}ms',
|
||||||
'body': 'Latency to gateway: {value}ms (threshold: {threshold}ms).',
|
'body': 'Latency to gateway: {value}ms (threshold: {threshold}ms).\nThis may indicate network congestion or hardware issues.',
|
||||||
'label': 'High network latency',
|
'label': 'High network latency',
|
||||||
'group': 'network',
|
'group': 'network',
|
||||||
'default_enabled': False,
|
'default_enabled': False,
|
||||||
@@ -593,21 +593,21 @@ TEMPLATES = {
|
|||||||
# ── Security events ──
|
# ── Security events ──
|
||||||
'auth_fail': {
|
'auth_fail': {
|
||||||
'title': '{hostname}: Authentication failure',
|
'title': '{hostname}: Authentication failure',
|
||||||
'body': 'Failed login attempt from {source_ip}.\nUser: {username}\nService: {service}',
|
'body': 'Failed login attempt detected.\nSource IP: {source_ip}\nUser: {username}\nService: {service}',
|
||||||
'label': 'Authentication failure',
|
'label': 'Authentication failure',
|
||||||
'group': 'security',
|
'group': 'security',
|
||||||
'default_enabled': True,
|
'default_enabled': True,
|
||||||
},
|
},
|
||||||
'ip_block': {
|
'ip_block': {
|
||||||
'title': '{hostname}: IP blocked by Fail2Ban',
|
'title': '{hostname}: IP blocked by Fail2Ban',
|
||||||
'body': 'IP {source_ip} has been banned.\nJail: {jail}\nFailures: {failures}',
|
'body': 'IP address {source_ip} has been banned.\nJail: {jail}\nFailed attempts: {failures}',
|
||||||
'label': 'IP blocked by Fail2Ban',
|
'label': 'IP blocked by Fail2Ban',
|
||||||
'group': 'security',
|
'group': 'security',
|
||||||
'default_enabled': True,
|
'default_enabled': True,
|
||||||
},
|
},
|
||||||
'firewall_issue': {
|
'firewall_issue': {
|
||||||
'title': '{hostname}: Firewall issue detected',
|
'title': '{hostname}: Firewall issue detected',
|
||||||
'body': '{reason}',
|
'body': 'A firewall configuration issue has been detected.\nReason: {reason}',
|
||||||
'label': 'Firewall issue detected',
|
'label': 'Firewall issue detected',
|
||||||
'group': 'security',
|
'group': 'security',
|
||||||
'default_enabled': True,
|
'default_enabled': True,
|
||||||
@@ -623,21 +623,21 @@ TEMPLATES = {
|
|||||||
# ── Cluster events ──
|
# ── Cluster events ──
|
||||||
'split_brain': {
|
'split_brain': {
|
||||||
'title': '{hostname}: SPLIT-BRAIN detected',
|
'title': '{hostname}: SPLIT-BRAIN detected',
|
||||||
'body': 'Cluster split-brain condition detected.\nQuorum status: {quorum}',
|
'body': 'A cluster split-brain condition has been detected. Quorum may be lost.\nQuorum status: {quorum}',
|
||||||
'label': 'SPLIT-BRAIN detected',
|
'label': 'SPLIT-BRAIN detected',
|
||||||
'group': 'cluster',
|
'group': 'cluster',
|
||||||
'default_enabled': True,
|
'default_enabled': True,
|
||||||
},
|
},
|
||||||
'node_disconnect': {
|
'node_disconnect': {
|
||||||
'title': '{hostname}: Node disconnected',
|
'title': '{hostname}: Node {node_name} disconnected',
|
||||||
'body': 'Node {node_name} has disconnected from the cluster.',
|
'body': 'Node {node_name} has disconnected from the cluster.',
|
||||||
'label': 'Node disconnected',
|
'label': 'Node disconnected',
|
||||||
'group': 'cluster',
|
'group': 'cluster',
|
||||||
'default_enabled': True,
|
'default_enabled': True,
|
||||||
},
|
},
|
||||||
'node_reconnect': {
|
'node_reconnect': {
|
||||||
'title': '{hostname}: Node reconnected',
|
'title': '{hostname}: Node {node_name} reconnected',
|
||||||
'body': 'Node {node_name} has reconnected to the cluster.',
|
'body': 'Node {node_name} has rejoined the cluster successfully.',
|
||||||
'label': 'Node reconnected',
|
'label': 'Node reconnected',
|
||||||
'group': 'cluster',
|
'group': 'cluster',
|
||||||
'default_enabled': True,
|
'default_enabled': True,
|
||||||
@@ -646,35 +646,35 @@ TEMPLATES = {
|
|||||||
# ── Services events ──
|
# ── Services events ──
|
||||||
'system_shutdown': {
|
'system_shutdown': {
|
||||||
'title': '{hostname}: System shutting down',
|
'title': '{hostname}: System shutting down',
|
||||||
'body': '{reason}',
|
'body': 'The node is shutting down.\n{reason}',
|
||||||
'label': 'System shutting down',
|
'label': 'System shutting down',
|
||||||
'group': 'services',
|
'group': 'services',
|
||||||
'default_enabled': True,
|
'default_enabled': True,
|
||||||
},
|
},
|
||||||
'system_reboot': {
|
'system_reboot': {
|
||||||
'title': '{hostname}: System rebooting',
|
'title': '{hostname}: System rebooting',
|
||||||
'body': '{reason}',
|
'body': 'The node is rebooting.\n{reason}',
|
||||||
'label': 'System rebooting',
|
'label': 'System rebooting',
|
||||||
'group': 'services',
|
'group': 'services',
|
||||||
'default_enabled': True,
|
'default_enabled': True,
|
||||||
},
|
},
|
||||||
'system_problem': {
|
'system_problem': {
|
||||||
'title': '{hostname}: System problem detected',
|
'title': '{hostname}: System problem detected',
|
||||||
'body': '{reason}',
|
'body': 'A system-level problem has been detected.\nReason: {reason}',
|
||||||
'label': 'System problem detected',
|
'label': 'System problem detected',
|
||||||
'group': 'services',
|
'group': 'services',
|
||||||
'default_enabled': True,
|
'default_enabled': True,
|
||||||
},
|
},
|
||||||
'service_fail': {
|
'service_fail': {
|
||||||
'title': '{hostname}: Service failed - {service_name}',
|
'title': '{hostname}: Service failed — {service_name}',
|
||||||
'body': '{reason}',
|
'body': 'System service "{service_name}" has failed.\nReason: {reason}',
|
||||||
'label': 'Service failed',
|
'label': 'Service failed',
|
||||||
'group': 'services',
|
'group': 'services',
|
||||||
'default_enabled': True,
|
'default_enabled': True,
|
||||||
},
|
},
|
||||||
'oom_kill': {
|
'oom_kill': {
|
||||||
'title': '{hostname}: OOM Kill - {process}',
|
'title': '{hostname}: OOM Kill — {process}',
|
||||||
'body': '{reason}',
|
'body': 'Process "{process}" was killed by the Out-of-Memory manager.\n{reason}',
|
||||||
'label': 'Out of memory kill',
|
'label': 'Out of memory kill',
|
||||||
'group': 'services',
|
'group': 'services',
|
||||||
'default_enabled': True,
|
'default_enabled': True,
|
||||||
@@ -725,14 +725,14 @@ TEMPLATES = {
|
|||||||
# ── Health Monitor events ──
|
# ── Health Monitor events ──
|
||||||
'health_persistent': {
|
'health_persistent': {
|
||||||
'title': '{hostname}: {count} active health issue(s)',
|
'title': '{hostname}: {count} active health issue(s)',
|
||||||
'body': 'The following health issues remain active:\n{issue_list}\n\nThis digest is sent once every 24 hours while issues persist.',
|
'body': 'The following health issues remain unresolved:\n{issue_list}\n\nThis digest is sent once every 24 hours while issues persist.',
|
||||||
'label': 'Active health issues (daily)',
|
'label': 'Active health issues (daily)',
|
||||||
'group': 'health',
|
'group': 'health',
|
||||||
'default_enabled': True,
|
'default_enabled': True,
|
||||||
},
|
},
|
||||||
'health_issue_new': {
|
'health_issue_new': {
|
||||||
'title': '{hostname}: New health issue - {category}',
|
'title': '{hostname}: New health issue — {category}',
|
||||||
'body': 'New {severity} issue detected:\n{reason}',
|
'body': 'New {severity} issue detected in: {category}\nDetails: {reason}',
|
||||||
'label': 'New health issue',
|
'label': 'New health issue',
|
||||||
'group': 'health',
|
'group': 'health',
|
||||||
'default_enabled': True,
|
'default_enabled': True,
|
||||||
@@ -762,14 +762,14 @@ TEMPLATES = {
|
|||||||
},
|
},
|
||||||
'pve_update': {
|
'pve_update': {
|
||||||
'title': '{hostname}: Proxmox VE {new_version} available',
|
'title': '{hostname}: Proxmox VE {new_version} available',
|
||||||
'body': 'Proxmox VE {current_version} -> {new_version}\n{details}',
|
'body': 'A new Proxmox VE release is available.\nCurrent: {current_version} → New: {new_version}\n{details}',
|
||||||
'label': 'Proxmox VE update available',
|
'label': 'Proxmox VE update available',
|
||||||
'group': 'updates',
|
'group': 'updates',
|
||||||
'default_enabled': True,
|
'default_enabled': True,
|
||||||
},
|
},
|
||||||
'update_complete': {
|
'update_complete': {
|
||||||
'title': '{hostname}: Update completed',
|
'title': '{hostname}: System update completed',
|
||||||
'body': '{details}',
|
'body': 'System packages have been successfully updated.\n{details}',
|
||||||
'label': 'Update completed',
|
'label': 'Update completed',
|
||||||
'group': 'updates',
|
'group': 'updates',
|
||||||
'default_enabled': False,
|
'default_enabled': False,
|
||||||
@@ -1239,95 +1239,166 @@ AI_DETAIL_TOKENS = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# System prompt template - informative, no recommendations
|
# System prompt template - informative, no recommendations
|
||||||
AI_SYSTEM_PROMPT = """You are a technical assistant for ProxMenux Monitor, a Proxmox server monitoring system.
|
AI_SYSTEM_PROMPT = """You are a system notification formatter for ProxMenux Monitor, a Proxmox VE monitoring tool.
|
||||||
|
|
||||||
Your task is to translate and format system alerts to {language}.
|
Your task is to translate and reformat incoming server alert messages into {language}.
|
||||||
|
|
||||||
STRICT RULES:
|
═══ ABSOLUTE RULES ═══
|
||||||
1. Translate BOTH the title and message body to {language}
|
1. Translate BOTH title and body to {language}. Every word, label, and unit must be in {language}.
|
||||||
2. DO NOT use markdown formatting like **bold** or *italic*
|
2. NO markdown: no **bold**, no *italic*, no `code`, no headers (#), no bullet lists (- or *)
|
||||||
3. Use plain text only - no special formatting syntax
|
3. Plain text only — the output is sent to chat apps and email which handle their own formatting
|
||||||
4. Maintain an INFORMATIVE and OBJECTIVE tone
|
4. Tone: factual, concise, technical. No greetings, no closings, no apologies
|
||||||
5. DO NOT use formal introductions ("Dear...", "Esteemed...")
|
5. DO NOT add recommendations, action items, or suggestions ("you should…", "consider…")
|
||||||
6. DO NOT give recommendations or action suggestions
|
6. Present ONLY the facts already in the input — do not invent or assume information
|
||||||
7. Present only FACTS and TECHNICAL DATA
|
7. Detail level to apply: {detail_level}
|
||||||
8. Respect the requested detail level: {detail_level}
|
- brief → 2-3 lines, essential data only (status + key metric)
|
||||||
|
- standard → short paragraph covering who/what/where and the key value
|
||||||
|
- detailed → full technical breakdown of all available fields
|
||||||
|
8. Keep the "hostname: " prefix in the title. Translate only the descriptive part.
|
||||||
|
Example: "pve01: Updates available" → "pve01: Actualizaciones disponibles"
|
||||||
{emoji_instructions}
|
{emoji_instructions}
|
||||||
|
|
||||||
DETAIL LEVELS:
|
═══ KNOWN MESSAGE TYPES AND HOW TO FORMAT THEM ═══
|
||||||
- brief: 2-3 lines maximum, only essential information
|
|
||||||
- standard: Concise paragraph with basic context
|
|
||||||
- detailed: Complete information with all available technical details
|
|
||||||
|
|
||||||
MESSAGE TYPES:
|
BACKUP (backup_complete / backup_fail / backup_start):
|
||||||
- Some messages come from Proxmox VE webhooks with raw system data (backup logs, update lists, SMART errors)
|
Input contains: VM/CT names, IDs, size, duration, storage location, status per VM
|
||||||
- Parse and present this data clearly, extracting key information (VM IDs, sizes, durations, errors)
|
Output body must list each VM on its own line: name, ID, status (ok/error), size, duration
|
||||||
- For backup messages: highlight status (OK/ERROR), VM names, sizes, and duration
|
End with a summary line: total VMs, total size, total time
|
||||||
- For update messages: list package names and counts clearly formatted
|
|
||||||
- For disk/SMART errors: highlight affected device and error type
|
|
||||||
|
|
||||||
OUTPUT FORMAT (VERY IMPORTANT):
|
UPDATES (update_summary / pve_update):
|
||||||
You MUST return the response in this exact format with these exact markers:
|
Input contains: total count, security count, proxmox count, kernel count, package list
|
||||||
|
Output body must show each count on its own line with its label
|
||||||
|
List important packages below, one per line
|
||||||
|
|
||||||
|
DISK / SMART ERRORS (disk_io_error / storage_unavailable):
|
||||||
|
Input contains: device name, error type, SMART values or I/O error codes
|
||||||
|
Output body: device, then the specific error or failing attribute
|
||||||
|
|
||||||
|
RESOURCES (cpu_high / ram_high / temp_high / load_high):
|
||||||
|
Input contains: current value, threshold, core count
|
||||||
|
Output: current value vs threshold, context if available
|
||||||
|
|
||||||
|
SECURITY (auth_fail / ip_block):
|
||||||
|
Input contains: source IP, user, service, jail, failure count
|
||||||
|
Output: list each field on its own line
|
||||||
|
|
||||||
|
VM/CT LIFECYCLE (vm_start, vm_stop, vm_fail, ct_*, migration_*, replication_*):
|
||||||
|
Input contains: VM name, ID, target node (migrations), reason (failures)
|
||||||
|
Output: one or two lines confirming the event with key facts
|
||||||
|
|
||||||
|
CLUSTER (split_brain / node_disconnect / node_reconnect):
|
||||||
|
Input: node name, quorum status
|
||||||
|
Output: state change + quorum value
|
||||||
|
|
||||||
|
HEALTH (new_error / error_resolved / health_persistent / health_degraded):
|
||||||
|
Input: category, severity, duration, reason
|
||||||
|
Output: what changed, in which category, for how long (if resolved)
|
||||||
|
|
||||||
|
═══ OUTPUT FORMAT (follow exactly — parsers rely on these markers) ═══
|
||||||
[TITLE]
|
[TITLE]
|
||||||
Translated title here
|
translated title here
|
||||||
[BODY]
|
[BODY]
|
||||||
Translated message body here
|
translated body here
|
||||||
|
|
||||||
- The [TITLE] section should contain ONLY the translated title (short, one line)
|
CRITICAL OUTPUT RULES:
|
||||||
- The [BODY] section contains the translated and formatted message
|
- Write [TITLE] on its own line, then the title on the very next line
|
||||||
- Do NOT include the markers [TITLE] or [BODY] as part of the content
|
- Write [BODY] on its own line, then the body starting on the very next line
|
||||||
- Start body content directly (emoji if enabled, then text)
|
- Do NOT write "Title:", "Título:", "Body:", "Cuerpo:" or any other label
|
||||||
|
- Do NOT include the literal words TITLE or BODY anywhere in the translated content
|
||||||
|
- Do NOT add extra blank lines between [TITLE] and the title text
|
||||||
|
- Do NOT add a blank line between [BODY] and the first body line"""
|
||||||
|
|
||||||
If journal log context is provided, use it for more precise event information."""
|
# Emoji instructions injected into AI_SYSTEM_PROMPT for rich channels (Telegram, Discord, Pushover)
|
||||||
|
|
||||||
# Emoji instructions for rich format channels
|
|
||||||
AI_EMOJI_INSTRUCTIONS = """
|
AI_EMOJI_INSTRUCTIONS = """
|
||||||
10. ENRICH with contextual emojis:
|
9. EMOJI USAGE — use real Unicode emoji characters as line-start icons:
|
||||||
- Start with a severity indicator circle: (blue=info), (yellow=warning), (red=critical)
|
|
||||||
- Add specific emojis for each data item, not just at the start
|
|
||||||
- Use emojis that match the content type precisely:
|
|
||||||
|
|
||||||
UPDATES/PACKAGES:
|
ONE emoji per line, placed at the very beginning of the line, before all text.
|
||||||
- Total updates count
|
Never place an emoji at the end of a line or mid-sentence.
|
||||||
- Security updates
|
Never use more than one emoji per line.
|
||||||
- Proxmox updates
|
Do not add emojis to blank lines.
|
||||||
- Kernel updates
|
|
||||||
- Package list items (bullet points)
|
|
||||||
|
|
||||||
BACKUP/STORAGE:
|
── TITLE ICONS (use the one matching the event type) ──
|
||||||
- Backup status
|
VM started / CT started ▶️
|
||||||
- Storage/disk
|
VM stopped / CT stopped ⏹️
|
||||||
- Sync/transfer
|
VM/CT shutdown ⏏️
|
||||||
- Folder/directory
|
VM/CT failed / crashed 💥
|
||||||
- Size/capacity
|
VM/CT restarted 🔄
|
||||||
|
Migration started 🚚
|
||||||
|
Migration complete ✅
|
||||||
|
Migration failed ❌
|
||||||
|
Replication failed ❌
|
||||||
|
Replication complete ✅
|
||||||
|
Backup started 📦
|
||||||
|
Backup complete ✅
|
||||||
|
Backup failed ❌
|
||||||
|
Snapshot created 📸
|
||||||
|
Snapshot failed ❌
|
||||||
|
High CPU 🔥
|
||||||
|
High memory 💧
|
||||||
|
High temperature 🌡️
|
||||||
|
High load ⚠️
|
||||||
|
Low disk space 📉
|
||||||
|
Disk I/O error 💥
|
||||||
|
Storage unavailable 🚫
|
||||||
|
Network down 🔌
|
||||||
|
High latency 🐢
|
||||||
|
Auth failure 🚨
|
||||||
|
IP blocked 🚷
|
||||||
|
Firewall issue 🔥
|
||||||
|
User permission change 🔑
|
||||||
|
Split-brain 💢
|
||||||
|
Node disconnected 🔌
|
||||||
|
Node reconnected ✅
|
||||||
|
System shutdown ⏻
|
||||||
|
System reboot 🔄
|
||||||
|
System problem ⚠️
|
||||||
|
Service failed ❌
|
||||||
|
OOM kill 💣
|
||||||
|
New health error 🆘
|
||||||
|
Health resolved ✅
|
||||||
|
Health escalated 🔺
|
||||||
|
Health degraded ⚠️
|
||||||
|
Health persistent (digest) 📋
|
||||||
|
Updates available 📦
|
||||||
|
PVE update available 🆕
|
||||||
|
Update complete ✅
|
||||||
|
|
||||||
SYSTEM/HARDWARE:
|
── BODY LINE ICONS (prepend to matching lines in the body) ──
|
||||||
- Server/host
|
Lines starting with VM name / CT name / ID 🏷️
|
||||||
- Container/VM
|
Lines with Size / Tamaño / Größe 📏
|
||||||
- CPU/processor
|
Lines with Duration / Duración / Dauer ⏱️
|
||||||
- Memory/RAM
|
Lines with Storage / Almacenamiento 🗄️
|
||||||
- Temperature
|
Lines with PBS path / archive 🗃️
|
||||||
|
Lines with Status: ok / éxito / success ✅
|
||||||
|
Lines with Status: error / failed / fallo ❌
|
||||||
|
Lines with Total (backup summary) 📊
|
||||||
|
Lines with Total updates / Actualizaciones 📦
|
||||||
|
Lines with Security updates / Seguridad 🔒
|
||||||
|
Lines with Proxmox updates 🔄
|
||||||
|
Lines with Kernel updates ⚙️
|
||||||
|
Lines with Important packages / Paquetes 📋
|
||||||
|
Lines with Source IP / IP origen 🌐
|
||||||
|
Lines with User / Usuario 👤
|
||||||
|
Lines with Service / Servicio ⚙️
|
||||||
|
Lines with Jail 🔒
|
||||||
|
Lines with Failed attempts / Intentos 🔢
|
||||||
|
Lines with Node / Nodo 🖥️
|
||||||
|
Lines with Reason / Motivo / Razón 📝
|
||||||
|
Lines with Temperature / Temperatura 🌡️
|
||||||
|
Lines with CPU usage / Uso CPU 🔥
|
||||||
|
Lines with Memory / Memoria 💧
|
||||||
|
Lines with Load / Carga 📊
|
||||||
|
Lines with Quorum 👥
|
||||||
|
Lines with Device / Dispositivo 💿
|
||||||
|
Lines with Filesystem / Ruta / Mount 📂
|
||||||
|
Lines with Category / Categoría 📌
|
||||||
|
Lines with Duration (health resolved) ⏱️
|
||||||
|
Lines with Severity / Severidad 🚦
|
||||||
|
Summary line at end of backup body 📊"""
|
||||||
|
|
||||||
NETWORK:
|
# No emoji instructions for email/plain text channels
|
||||||
- Network/connection
|
|
||||||
- Speed/bandwidth
|
|
||||||
- Globe/internet
|
|
||||||
|
|
||||||
SECURITY/ALERTS:
|
|
||||||
- Warning/alert
|
|
||||||
- Security/shield
|
|
||||||
- Error/problem
|
|
||||||
- Lock/authentication
|
|
||||||
|
|
||||||
STATUS:
|
|
||||||
- Success/OK
|
|
||||||
- Failed/error
|
|
||||||
- Running/active
|
|
||||||
- Stopped/inactive"""
|
|
||||||
|
|
||||||
# No emoji instructions for email/plain channels
|
|
||||||
AI_NO_EMOJI_INSTRUCTIONS = """
|
AI_NO_EMOJI_INSTRUCTIONS = """
|
||||||
10. DO NOT use emojis or special icons - plain text only for email compatibility"""
|
9. DO NOT use any emojis or special Unicode symbols. Plain ASCII text only for email compatibility."""
|
||||||
|
|
||||||
|
|
||||||
class AIEnhancer:
|
class AIEnhancer:
|
||||||
|
|||||||
Reference in New Issue
Block a user