fix(qualys/agents): retry avec reconnect SSH si Timeout opening channel (limite channels PSMP)
This commit is contained in:
parent
fc480b4376
commit
d4205fb8f8
@ -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"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user