From b974980d08541ba641aeb370131ff1aac84fa0a8 Mon Sep 17 00:00:00 2001 From: Snarf Date: Thu, 5 Nov 2026 06:50:56 -0500 Subject: [PATCH] feat: add script to check cattle-system pods and events on spaceport server --- scripts/check_cattle_spaceport.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 scripts/check_cattle_spaceport.py diff --git a/scripts/check_cattle_spaceport.py b/scripts/check_cattle_spaceport.py new file mode 100644 index 0000000..3b78a11 --- /dev/null +++ b/scripts/check_cattle_spaceport.py @@ -0,0 +1,28 @@ +import paramiko +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()) + +client.connect("140.44.4.41", username="root", key_filename=key_path, timeout=10) + +cmds = [ + "k3s kubectl -n cattle-system get pods -o wide", + "k3s kubectl -n cattle-system describe pod -l app=cattle-cluster-agent", + "k3s kubectl get events -A --sort-by='.lastTimestamp' | tail -n 20" +] + +for cmd in cmds: + print(f"\n==========================================") + print(f">>> Running on Spaceport: {cmd}") + print(f"==========================================") + stdin, stdout, stderr = client.exec_command(cmd) + print(stdout.read().decode('utf-8')) + err = stderr.read().decode('utf-8') + if err: + print("STDERR:", err) + +client.close()