feat: add homelab deployment configs, documentation, and automation scripts
This commit is contained in:
27
scripts/check_grafana_api.py
Normal file
27
scripts/check_grafana_api.py
Normal file
@@ -0,0 +1,27 @@
|
||||
import requests
|
||||
import json
|
||||
import urllib3
|
||||
urllib3.disable_warnings()
|
||||
|
||||
auth = ('admin', 'd0KJLZJXUrbIhW1sjU8lrdFYj7VXts26V7Jw7xQr')
|
||||
|
||||
try:
|
||||
r = requests.get('https://grafana.snarfnet.net/api/datasources', auth=auth, verify=False, timeout=10)
|
||||
print("Datasources Status:", r.status_code)
|
||||
if r.status_code == 200:
|
||||
for ds in r.json():
|
||||
print(f" - ID: {ds.get('id')}, Name: {ds.get('name')}, Type: {ds.get('type')}, URL: {ds.get('url')}, isDefault: {ds.get('isDefault')}")
|
||||
except Exception as e:
|
||||
print("Error getting datasources:", e)
|
||||
|
||||
try:
|
||||
r = requests.get('https://grafana.snarfnet.net/api/search', auth=auth, verify=False, timeout=10)
|
||||
print("Dashboards Status:", r.status_code)
|
||||
if r.status_code == 200:
|
||||
dashboards = r.json()
|
||||
print(f"Total dashboards: {len(dashboards)}")
|
||||
for d in dashboards[:15]:
|
||||
print(f" - {d.get('title')} (uri: {d.get('uri')}, type: {d.get('type')})")
|
||||
except Exception as e:
|
||||
print("Error getting dashboards:", e)
|
||||
|
||||
Reference in New Issue
Block a user