feat: add cluster auditing, management, and upgrade scripts
This commit is contained in:
22
scripts/check_peanut_now.py
Normal file
22
scripts/check_peanut_now.py
Normal file
@@ -0,0 +1,22 @@
|
||||
import paramiko
|
||||
import sys
|
||||
|
||||
sys.stdout.reconfigure(encoding='utf-8')
|
||||
|
||||
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)
|
||||
|
||||
def run(cmd):
|
||||
print(f"=== {cmd} ===")
|
||||
_, out, err = ssh.exec_command(cmd)
|
||||
res = out.read().decode('utf-8', errors='replace').strip()
|
||||
if res:
|
||||
print(res)
|
||||
|
||||
run("sudo docker service logs peanut_peanut --tail=25")
|
||||
run("curl -s -I http://140.44.4.70:8050/")
|
||||
run("curl -s http://140.44.4.70:8050/ | grep -i setup || echo 'NO SETUP REDIRECT'")
|
||||
|
||||
ssh.close()
|
||||
|
||||
Reference in New Issue
Block a user