feat: add infrastructure audit and diagnostic helper scripts
This commit is contained in:
38
scripts/check_vault_rancher.py
Normal file
38
scripts/check_vault_rancher.py
Normal file
@@ -0,0 +1,38 @@
|
||||
import paramiko
|
||||
|
||||
key_path = r'C:\Users\Snarf\.ssh\id_ed25519_snarfnet'
|
||||
|
||||
def check_vault_and_rancher():
|
||||
print("=== Checking Rancher and Vault ===")
|
||||
ssh = paramiko.SSHClient()
|
||||
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
||||
ssh.connect('140.44.4.11', username='root', key_filename=key_path, timeout=10)
|
||||
|
||||
# Check rancher pods and ingress
|
||||
stdin, stdout, stderr = ssh.exec_command("k3s kubectl get pods -A | grep -E 'rancher|vault' || true")
|
||||
print("Rancher/Vault pods on Aerodrome:")
|
||||
print(stdout.read().decode())
|
||||
|
||||
stdin, stdout, stderr = ssh.exec_command("k3s kubectl get ingress -A | grep -E 'rancher|vault' || true")
|
||||
print("Rancher/Vault ingress on Aerodrome:")
|
||||
print(stdout.read().decode())
|
||||
|
||||
ssh.close()
|
||||
|
||||
ssh2 = paramiko.SSHClient()
|
||||
ssh2.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
||||
ssh2.connect('140.44.4.41', username='root', key_filename=key_path, timeout=10)
|
||||
|
||||
stdin, stdout, stderr = ssh2.exec_command("k3s kubectl get pods -A | grep -E 'rancher|vault' || true")
|
||||
print("Rancher/Vault pods on Spaceport:")
|
||||
print(stdout.read().decode())
|
||||
|
||||
# Check pending svclb pods on Spaceport
|
||||
stdin, stdout, stderr = ssh2.exec_command("k3s kubectl get pods -n kube-system | grep svclb-pihole || true")
|
||||
print("svclb pods on Spaceport:")
|
||||
print(stdout.read().decode())
|
||||
|
||||
ssh2.close()
|
||||
|
||||
check_vault_and_rancher()
|
||||
|
||||
Reference in New Issue
Block a user