Files
SnarfCode/scripts/test_shipyard_metrics.py

12 lines
532 B
Python

import paramiko
c = paramiko.SSHClient()
c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
c.connect('140.44.4.71', username='snarf', key_filename=r'C:\Users\Snarf\.ssh\id_ed25519_snarfnet', timeout=10)
_, o, _ = c.exec_command("curl -s http://127.0.0.1:9100/metrics | grep -E '^node_load1 '")
print("Node exporter test:", o.read().decode().strip())
_, o2, _ = c.exec_command("curl -s http://127.0.0.1:8080/metrics | grep -E '^container_last_seen' | head -3")
print("cAdvisor test:\n", o2.read().decode().strip())
c.close()