feat: add cluster auditing, management, and upgrade scripts
This commit is contained in:
26
scripts/inspect_swarm_status.py
Normal file
26
scripts/inspect_swarm_status.py
Normal file
@@ -0,0 +1,26 @@
|
||||
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=8)
|
||||
|
||||
stdin, stdout, stderr = ssh.exec_command('sudo docker node ls')
|
||||
print("=== DOCKER NODES ===")
|
||||
print(stdout.read().decode())
|
||||
|
||||
stdin, stdout, stderr = ssh.exec_command('sudo docker service ls')
|
||||
print("=== DOCKER SERVICES ===")
|
||||
print(stdout.read().decode())
|
||||
|
||||
stdin, stdout, stderr = ssh.exec_command('ip addr show | grep 140.44.4')
|
||||
print("=== IP ADDRESSES ON SWM01 ===")
|
||||
print(stdout.read().decode())
|
||||
|
||||
stdin, stdout, stderr = ssh.exec_command('systemctl is-active keepalived')
|
||||
print("Keepalived status:", stdout.read().decode().strip())
|
||||
|
||||
ssh.close()
|
||||
|
||||
Reference in New Issue
Block a user