mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2026-04-28 10:26:26 +00:00
update notification service
This commit is contained in:
@@ -88,7 +88,7 @@ cp "$SCRIPT_DIR/flask_proxmenux_routes.py" "$APP_DIR/usr/bin/" 2>/dev/null || ec
|
|||||||
cp "$SCRIPT_DIR/flask_terminal_routes.py" "$APP_DIR/usr/bin/" 2>/dev/null || echo "⚠️ flask_terminal_routes.py not found"
|
cp "$SCRIPT_DIR/flask_terminal_routes.py" "$APP_DIR/usr/bin/" 2>/dev/null || echo "⚠️ flask_terminal_routes.py not found"
|
||||||
cp "$SCRIPT_DIR/hardware_monitor.py" "$APP_DIR/usr/bin/" 2>/dev/null || echo "⚠️ hardware_monitor.py not found"
|
cp "$SCRIPT_DIR/hardware_monitor.py" "$APP_DIR/usr/bin/" 2>/dev/null || echo "⚠️ hardware_monitor.py not found"
|
||||||
cp "$SCRIPT_DIR/proxmox_storage_monitor.py" "$APP_DIR/usr/bin/" 2>/dev/null || echo "⚠️ proxmox_storage_monitor.py not found"
|
cp "$SCRIPT_DIR/proxmox_storage_monitor.py" "$APP_DIR/usr/bin/" 2>/dev/null || echo "⚠️ proxmox_storage_monitor.py not found"
|
||||||
cp "$SCRIPT_DIR/flask_script_runner.py" "$APP_DIR/usr/bin/" 2>/dev/null || echo "⚠️ flask_script_runner.py not found"
|
cp "$SCRIPT_DIR/flask_script_runner.py" "$APP_DIR/usr/bin/" 2>/dev/null || echo "<EFBFBD><EFBFBD><EFBFBD>️ flask_script_runner.py not found"
|
||||||
cp "$SCRIPT_DIR/security_manager.py" "$APP_DIR/usr/bin/" 2>/dev/null || echo "⚠️ security_manager.py not found"
|
cp "$SCRIPT_DIR/security_manager.py" "$APP_DIR/usr/bin/" 2>/dev/null || echo "⚠️ security_manager.py not found"
|
||||||
cp "$SCRIPT_DIR/flask_security_routes.py" "$APP_DIR/usr/bin/" 2>/dev/null || echo "⚠️ flask_security_routes.py not found"
|
cp "$SCRIPT_DIR/flask_security_routes.py" "$APP_DIR/usr/bin/" 2>/dev/null || echo "⚠️ flask_security_routes.py not found"
|
||||||
cp "$SCRIPT_DIR/notification_manager.py" "$APP_DIR/usr/bin/" 2>/dev/null || echo "⚠️ notification_manager.py not found"
|
cp "$SCRIPT_DIR/notification_manager.py" "$APP_DIR/usr/bin/" 2>/dev/null || echo "⚠️ notification_manager.py not found"
|
||||||
|
|||||||
@@ -876,6 +876,10 @@ def _health_collector_loop():
|
|||||||
'updates': 'System Updates',
|
'updates': 'System Updates',
|
||||||
'security': 'Security',
|
'security': 'Security',
|
||||||
}
|
}
|
||||||
|
# Categories to suppress during startup grace period (transient issues)
|
||||||
|
_STARTUP_GRACE_CATEGORIES = {'storage', 'vms', 'network', 'services'}
|
||||||
|
_STARTUP_GRACE_SECONDS = 300 # 5 minutes
|
||||||
|
_collector_start_time = time.time()
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
@@ -933,6 +937,12 @@ def _health_collector_loop():
|
|||||||
skip_notification = True
|
skip_notification = True
|
||||||
break
|
break
|
||||||
|
|
||||||
|
# Startup grace period: skip transient issues from categories
|
||||||
|
# that typically need time to stabilize after boot
|
||||||
|
in_grace_period = (time.time() - _collector_start_time) < _STARTUP_GRACE_SECONDS
|
||||||
|
if in_grace_period and cat_key in _STARTUP_GRACE_CATEGORIES:
|
||||||
|
skip_notification = True
|
||||||
|
|
||||||
if not skip_notification:
|
if not skip_notification:
|
||||||
degraded.append({
|
degraded.append({
|
||||||
'category': cat_name,
|
'category': cat_name,
|
||||||
|
|||||||
@@ -1135,7 +1135,7 @@ class HealthPersistence:
|
|||||||
# This avoids redundant subprocess calls and ensures immediate detection
|
# This avoids redundant subprocess calls and ensures immediate detection
|
||||||
# when the user adds new ZFS/LVM storage via Proxmox.
|
# when the user adds new ZFS/LVM storage via Proxmox.
|
||||||
|
|
||||||
# ─── User Settings ──────────────────────────────────────────
|
# ─── User Settings ────────────────────────<EFBFBD><EFBFBD>─────────────────
|
||||||
|
|
||||||
def get_setting(self, key: str, default: Optional[str] = None) -> Optional[str]:
|
def get_setting(self, key: str, default: Optional[str] = None) -> Optional[str]:
|
||||||
"""Get a user setting value by key."""
|
"""Get a user setting value by key."""
|
||||||
|
|||||||
@@ -221,7 +221,7 @@ def capture_journal_context(keywords: list, lines: int = 30,
|
|||||||
return ""
|
return ""
|
||||||
|
|
||||||
|
|
||||||
# ─── Journal Watcher (Real-time) ───<EFBFBD><EFBFBD>─────────────────────────────
|
# ─── Journal Watcher (Real-time) ─────────────────────────────────
|
||||||
|
|
||||||
class JournalWatcher:
|
class JournalWatcher:
|
||||||
"""Watches journald in real-time for critical system events.
|
"""Watches journald in real-time for critical system events.
|
||||||
|
|||||||
@@ -1841,7 +1841,7 @@ class NotificationManager:
|
|||||||
notification_manager = NotificationManager()
|
notification_manager = NotificationManager()
|
||||||
|
|
||||||
|
|
||||||
# ─── CLI Interface ────────────────────────────────────────────────
|
# ─── CLI Interface ───────────────────────────────────────<EFBFBD><EFBFBD><EFBFBD>────────
|
||||||
|
|
||||||
def _print_result(result: Dict, as_json: bool):
|
def _print_result(result: Dict, as_json: bool):
|
||||||
"""Print CLI result in human-readable or JSON format."""
|
"""Print CLI result in human-readable or JSON format."""
|
||||||
|
|||||||
@@ -1612,7 +1612,7 @@ A blank line must be completely empty — no emoji, no spaces.
|
|||||||
💥 Disk I/O error on /dev/sda: 1 sector currently unreadable (pending)
|
💥 Disk I/O error on /dev/sda: 1 sector currently unreadable (pending)
|
||||||
|
|
||||||
🏷️ Container CT 9005: ❌ failed to start
|
🏷️ Container CT 9005: ❌ failed to start
|
||||||
🏷️ Container CT 9004: ❌ failed to start
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>️ Container CT 9004: ❌ failed to start
|
||||||
🏷️ Container CT 9002: ❌ failed to start"""
|
🏷️ Container CT 9002: ❌ failed to start"""
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user