From eecb61c72093763a7b97eb9231ebb18feec1e021 Mon Sep 17 00:00:00 2001 From: Admin MPCZ Date: Tue, 28 Apr 2026 01:45:48 +0200 Subject: [PATCH] fix(qualys/agents): check service multi-format - SysV init francais (en cours d'execution / (pid X)) en plus de systemd active (running) --- app/services/realtime_audit_service.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/app/services/realtime_audit_service.py b/app/services/realtime_audit_service.py index 4dc4f6c..7c48f6a 100644 --- a/app/services/realtime_audit_service.py +++ b/app/services/realtime_audit_service.py @@ -979,8 +979,20 @@ def audit_qualys_agent_only(hostname): result["check_connectivity"] = "Connectivité OK" in s_conn result["check_disk"] = " 100%" not in s_disk - result["check_service"] = "active (running)" in s_status or \ - ("running" in s_status and "active" in s_status) + # Multi-format : systemd ("active (running)"), SysV anglais ("is running" / "(pid"), + # SysV français RHEL 5/6 ("en cours d'exécution") + is_running = ( + "active (running)" in s_status + or "(pid " in s_status + or "is running" in s_status + or "en cours d'exécution" in s_status + or "en cours d'execution" in s_status # sans accent + ) + is_stopped = any(k in s_status for k in [ + "inactive (dead)", "stopped", "not running", + "n'est pas en cours", "is not running" + ]) + result["check_service"] = is_running and not is_stopped result["check_installed"] = bool(re.search(r"qualys-cloud-agent[-\s]\d", s_ver)) # Ligne saturee si disque KO