Files
SnarfCode/scripts/check_spaceport_lh.py

21 lines
706 B
Python

import paramiko
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect('140.44.4.41', username='root', key_filename=r'C:\Users\Snarf\.ssh\id_ed25519_snarfnet', timeout=10)
stdin, stdout, stderr = ssh.exec_command('kubectl get pvc -A')
print("=== SPACEPORT PVCs ===")
print(stdout.read().decode())
stdin, stdout, stderr = ssh.exec_command('kubectl get recurringjob -n longhorn-system')
print("=== SPACEPORT RECURRING JOBS ===")
print(stdout.read().decode())
stdin, stdout, stderr = ssh.exec_command('kubectl get settings.longhorn.io -n longhorn-system backup-target -o yaml')
print("=== SPACEPORT BACKUP TARGET ===")
print(stdout.read().decode())
ssh.close()