feat: add various infrastructure check and automation scripts
This commit is contained in:
24
scripts/check_panel_targets.py
Normal file
24
scripts/check_panel_targets.py
Normal file
@@ -0,0 +1,24 @@
|
||||
import requests
|
||||
import json
|
||||
import urllib3
|
||||
urllib3.disable_warnings()
|
||||
|
||||
auth = ("admin", "Katzir476!!!")
|
||||
resp = requests.get("https://grafana.snarfnet.net/api/dashboards/uid/snarfnet-systems", auth=auth, verify=False)
|
||||
dash = resp.json()["dashboard"]
|
||||
print("--- Systems Dashboard Targets ---")
|
||||
for p in dash.get("panels", []):
|
||||
targets = p.get("targets", [])
|
||||
if targets:
|
||||
exprs = [t.get("expr") for t in targets]
|
||||
print(f"Panel: {p.get('title')} -> Exprs: {exprs}")
|
||||
|
||||
resp2 = requests.get("https://grafana.snarfnet.net/api/dashboards/uid/snarfnet-containers", auth=auth, verify=False)
|
||||
dash2 = resp2.json()["dashboard"]
|
||||
print("\n--- Containers Dashboard Targets ---")
|
||||
for p in dash2.get("panels", []):
|
||||
targets = p.get("targets", [])
|
||||
if targets:
|
||||
exprs = [t.get("expr") for t in targets]
|
||||
print(f"Panel: {p.get('title')} -> Exprs: {exprs}")
|
||||
|
||||
Reference in New Issue
Block a user