feat: add cluster management and audit utility scripts
This commit is contained in:
@@ -4,12 +4,15 @@ import sys
|
||||
sys.stdout.reconfigure(encoding='utf-8')
|
||||
|
||||
key_path = r"C:\Users\Snarf\.ssh\id_ed25519_snarfnet"
|
||||
client = paramiko.SSHClient()
|
||||
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
||||
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)
|
||||
|
||||
client.connect("140.44.4.71", username="root", key_filename=key_path, timeout=10)
|
||||
stdin, stdout, stderr = client.exec_command('docker exec $(docker ps -q -f name=npm) sqlite3 /data/database.sqlite "SELECT domain_names, forward_host, forward_port FROM proxy_host;"')
|
||||
print("NPM hosts:")
|
||||
cmd = """docker service ls"""
|
||||
stdin, stdout, stderr = c.exec_command(cmd)
|
||||
print("SERVICES:")
|
||||
print(stdout.read().decode('utf-8'))
|
||||
client.close()
|
||||
|
||||
|
||||
|
||||
c.close()
|
||||
|
||||
Reference in New Issue
Block a user