I use this way:
servers = ["192.168.100.161", "192.168.100.162", "192.168.100.163"]
top_command = "top -b -n 1"
host_config = make_host_config(servers)
client = ParallelSSHClient(servers, timeout=2, num_retries=1, retry_delay=1, host_config=host_config)
try:
output = client.run_command(top_command, sudo=True)
print([(k, [x for x in v.stdout], [x for x in v.stderr]) for (k, v) in output.items()])
for host, host_response in output:
print(host, host_response)
except Exception as e:
print("failed to connect some host: ", e)
What do I get now: an exception.
failed to connect some host: ("Error connecting to host '%s:%s' - %s - retry %s/%s", '192.168.100.161', 22, 'timed out', 1, 1)
What I desire to get: Responses from available servers Errors from unavailable servers
How to achieve it, guys?