feat: add helper scripts for infrastructure management and troubleshooting

This commit is contained in:
2026-11-06 15:24:05 -05:00
parent aea8608f3d
commit 1965d37687
48 changed files with 1399 additions and 39 deletions

View File

@@ -0,0 +1,30 @@
import paramiko
import sys
sys.stdout.reconfigure(encoding='utf-8')
key_path = r'C:\Users\Snarf\.ssh\id_ed25519_snarfnet'
def check_cluster(ip, name):
print(f"\n--- Checking Pi-hole on {name} ({ip}) ---")
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(ip, username='root', key_filename=key_path, timeout=10)
# Check Pi-hole pod name
stdin, stdout, stderr = ssh.exec_command("k3s kubectl get pods -n dns -l app=pihole -o jsonpath='{.items[0].metadata.name}'")
pod_name = stdout.read().decode().strip()
print(f"Pod name: {pod_name}")
# Check password in setupVars or FTL
stdin, stdout, stderr = ssh.exec_command(f"k3s kubectl exec -n dns {pod_name} -- grep -i pwhash /etc/pihole/pihole-FTL.conf /etc/pihole/setupVars.conf")
print("Password hash check:\n", stdout.read().decode())
# Test curl to localhost:80/admin/
stdin, stdout, stderr = ssh.exec_command(f"k3s kubectl exec -n dns {pod_name} -- curl -s -I http://localhost/admin/")
print("Local admin response:\n", stdout.read().decode())
ssh.close()
check_cluster('140.44.4.11', 'Aerodrome')
check_cluster('140.44.4.41', 'Spaceport')