diff --git a/app/services/realtime_audit_service.py b/app/services/realtime_audit_service.py index 4a248b1..7be0db9 100644 --- a/app/services/realtime_audit_service.py +++ b/app/services/realtime_audit_service.py @@ -932,7 +932,18 @@ def audit_qualys_agent_only(hostname): try: for key, cmd in QUALYS_AGENT_CMDS.items(): - result[key] = _run(client, cmd) or "(empty)" + out = _run(client, cmd) + # Retry avec reconnect si Timeout opening channel (limite PSMP) + if out and ("timeout opening channel" in out.lower() or + "channel closed" in out.lower()): + try: + client.close() + except Exception: + pass + client = _connect(target, hostname) + if client: + out = _run(client, cmd) + result[key] = out or "(empty)" result["status"] = "OK" except Exception as e: result["status"] = "ERROR"