15 lines
405 B
Python
15 lines
405 B
Python
import paramiko
|
|
|
|
c = paramiko.SSHClient()
|
|
c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
|
c.connect('140.44.4.71', username='root', key_filename=r'C:\Users\Snarf\.ssh\id_ed25519_snarfnet', timeout=10)
|
|
|
|
_, o, _ = c.exec_command('docker ps --format "{{.Names}}\t{{.Image}}\t{{.Ports}}"')
|
|
print(o.read().decode())
|
|
|
|
_, o2, _ = c.exec_command('docker service ls')
|
|
print(o2.read().decode())
|
|
|
|
c.close()
|
|
|