feat: add various infrastructure check and automation scripts
This commit is contained in:
24
scripts/check_shipyard_nodes.py
Normal file
24
scripts/check_shipyard_nodes.py
Normal file
@@ -0,0 +1,24 @@
|
||||
import paramiko
|
||||
import sys
|
||||
|
||||
sys.stdout.reconfigure(encoding='utf-8')
|
||||
c = paramiko.SSHClient()
|
||||
c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
||||
c.connect('140.44.4.71', username='snarf', key_filename=r'C:\Users\Snarf\.ssh\id_ed25519_snarfnet', timeout=10)
|
||||
|
||||
def run(cmd):
|
||||
_, o, e = c.exec_command(cmd)
|
||||
out = o.read().decode().strip()
|
||||
err = e.read().decode().strip()
|
||||
if err:
|
||||
print("ERR:", err)
|
||||
return out
|
||||
|
||||
print("--- Docker Swarm Nodes ---")
|
||||
print(run("echo 'Katzir476!' | sudo -S docker node ls"))
|
||||
|
||||
print("\n--- Existing Docker Swarm Stacks/Services ---")
|
||||
print(run("echo 'Katzir476!' | sudo -S docker service ls"))
|
||||
|
||||
c.close()
|
||||
|
||||
Reference in New Issue
Block a user