Files
SnarfCode/scripts/test_glances_endpoint.py

16 lines
483 B
Python

import requests
for v in [3, 4]:
try:
r = requests.get(f"http://140.44.4.11:61208/api/{v}/quicklook", timeout=3)
print(f"Glances v{v} status:", r.status_code, r.text[:200])
except Exception as e:
print(f"Glances v{v} err:", e)
try:
r = requests.get(f"http://140.44.4.11:61208/api/{v}/cpu", timeout=3)
print(f"Glances v{v} cpu:", r.status_code, r.text[:200])
except Exception as e:
print(f"Glances v{v} cpu err:", e)