Files
SnarfCode/scripts/check_monitoring_ns.py

18 lines
623 B
Python

import paramiko
def check_ns(ip, name):
c = paramiko.SSHClient()
c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
c.connect(ip, username='root', key_filename=r'C:\Users\Snarf\.ssh\id_ed25519_snarfnet', timeout=10)
print(f"=== {name} ({ip}) ===")
_, o, _ = c.exec_command("kubectl get all -n monitoring")
print(o.read().decode())
if name == 'Aerodrome':
_, o, _ = c.exec_command("kubectl get all -n cattle-monitoring-system")
print("cattle-monitoring-system:\n", o.read().decode())
c.close()
check_ns('140.44.4.11', 'Aerodrome')
check_ns('140.44.4.41', 'Spaceport')