feat: add various infrastructure and service diagnostic scripts
This commit is contained in:
@@ -1,14 +1,13 @@
|
||||
import paramiko
|
||||
import sys
|
||||
|
||||
ssh = paramiko.SSHClient()
|
||||
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
||||
ssh.connect('140.44.4.71', username='snarf', key_filename=r'C:\Users\Snarf\.ssh\id_ed25519_snarfnet', timeout=10)
|
||||
sys.stdout.reconfigure(encoding='utf-8')
|
||||
|
||||
def run(cmd):
|
||||
print(f"=== {cmd} ===")
|
||||
stdin, stdout, stderr = ssh.exec_command(cmd)
|
||||
print(stdout.read().decode())
|
||||
|
||||
run("sudo docker service ps nginx-proxy-manager_app --filter 'desired-state=running'")
|
||||
ssh.close()
|
||||
key_path = r"C:\Users\Snarf\.ssh\id_ed25519_snarfnet"
|
||||
c = paramiko.SSHClient()
|
||||
c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
||||
c.connect("140.44.4.71", username="root", key_filename=key_path, timeout=5)
|
||||
|
||||
stdin, stdout, stderr = c.exec_command("docker service ps nginx-proxy-manager_app")
|
||||
print(stdout.read().decode('utf-8'))
|
||||
c.close()
|
||||
|
||||
Reference in New Issue
Block a user