feat: add various infrastructure check and automation scripts
This commit is contained in:
15
scripts/check_shipyard_prom_targets.py
Normal file
15
scripts/check_shipyard_prom_targets.py
Normal file
@@ -0,0 +1,15 @@
|
||||
import requests
|
||||
import json
|
||||
import urllib3
|
||||
urllib3.disable_warnings()
|
||||
|
||||
auth = ("admin", "Katzir476!!!")
|
||||
url = "https://grafana.snarfnet.net/api/datasources/proxy/1/api/v1/targets"
|
||||
resp = requests.get(url, auth=auth, verify=False, timeout=10)
|
||||
targets = resp.json().get("data", {}).get("activeTargets", [])
|
||||
print(f"Total Active Targets: {len(targets)}")
|
||||
jobs = set(t.get("labels", {}).get("job") for t in targets)
|
||||
print("Active Jobs:", jobs)
|
||||
for t in targets:
|
||||
if "node" in t.get("labels", {}).get("job", "") or "shipyard" in t.get("labels", {}).get("job", ""):
|
||||
print(f" Job: {t.get('labels', {}).get('job')} | Labels: {t.get('labels')} | Health: {t.get('health')}")
|
||||
Reference in New Issue
Block a user