fix(qualys/agents): retry avec reconnect SSH si Timeout opening channel (limite channels PSMP)

This commit is contained in:
Pierre & Lumière 2026-04-28 01:14:03 +02:00
parent fc480b4376
commit d4205fb8f8

View File

@ -932,7 +932,18 @@ def audit_qualys_agent_only(hostname):
try: try:
for key, cmd in QUALYS_AGENT_CMDS.items(): 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" result["status"] = "OK"
except Exception as e: except Exception as e:
result["status"] = "ERROR" result["status"] = "ERROR"