feat: add various infrastructure check and automation scripts
This commit is contained in:
19
scripts/check_heimdall_mount_real.py
Normal file
19
scripts/check_heimdall_mount_real.py
Normal file
@@ -0,0 +1,19 @@
|
||||
import paramiko
|
||||
|
||||
c = paramiko.SSHClient()
|
||||
c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
||||
c.connect("140.44.4.71", username="snarf", password="Katzir476!", timeout=10)
|
||||
|
||||
def run(cmd):
|
||||
full_cmd = f"echo Katzir476! | sudo -S sh -c '{cmd}'"
|
||||
_, o, e = c.exec_command(full_cmd)
|
||||
return o.read().decode().strip(), e.read().decode().strip()
|
||||
|
||||
out, _ = run("docker inspect $(docker ps -q -f name=heimdall) | grep -A 10 -i mounts")
|
||||
print("Container Mounts:\n", out)
|
||||
|
||||
out, _ = run("docker service inspect heimdall_heimdall --pretty")
|
||||
print("\nService inspect pretty:\n", out)
|
||||
|
||||
c.close()
|
||||
|
||||
Reference in New Issue
Block a user