24 lines
696 B
Python
24 lines
696 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} ===")
|
|
_, out, err = ssh.exec_command(cmd)
|
|
res = out.read().decode().strip()
|
|
if res:
|
|
print(res)
|
|
e = err.read().decode().strip()
|
|
if e:
|
|
print("ERR:", e)
|
|
|
|
run("kubectl get pod -n infrastructure jenkins-0 -o wide")
|
|
run("kubectl describe pod -n infrastructure jenkins-0 | tail -n 25")
|
|
run("curl -k -s -I https://jenkins.snarfnet.net | head -n 5")
|
|
run("curl -s -I http://140.44.4.52:101 | head -n 5")
|
|
|
|
ssh.close()
|
|
|