stackoverflow.com/questions/28288533/check-if-paramiko-ssh-connection-is-still-alive
Check if paramiko ssh connection is still alive
Is there a way to check if a paramiko SSH connection is still alive? In [1]: import paramiko In [2]: ssh = paramiko.SSHClient() In [3]: ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())...
stackoverflow.com
if ssh.get_transport() is not None:
print(ssh.get_transport().is_active())
docs.paramiko.org/en/2.4/api/transport.html#paramiko.transport.Transport.is_active
'시행착오 > [python]' 카테고리의 다른 글
[python] 로컬 및 원격 서버내 파일/디렉토리 존재 확인법 (0) | 2021.05.04 |
---|---|
[python] filter 함수 사용시 주의할 점 - iterator (0) | 2021.04.21 |
[python] asyncio + multithreading: one asyncio event loop per thread (0) | 2021.04.14 |
[python] __enter__, __exit__ context manager - 파이썬 with custom하기 (0) | 2021.04.02 |
python에서 json data다룰때 key가 존재하는지 확인하는 방법 (0) | 2021.03.31 |