17 lines
697 B
Python
17 lines
697 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)
|
|
|
|
def run(cmd):
|
|
print(f"=== {cmd} ===")
|
|
stdin, stdout, stderr = ssh.exec_command(cmd)
|
|
print(stdout.read().decode())
|
|
|
|
run("kubectl get pods -A | grep -v -E 'Running|Completed' || true")
|
|
run("kubectl get volumes.longhorn.io -n longhorn-system -o custom-columns=NAME:.metadata.name,ROBUSTNESS:.status.robustness,STATE:.status.state")
|
|
run("kubectl get applications -A -o custom-columns=NAME:.metadata.name,SYNC:.status.sync.status,HEALTH:.status.health.status")
|
|
ssh.close()
|
|
|