mirror of
https://github.com/ced4568/ceds-noc.git
synced 2026-08-12 21:04:02 +00:00
Add real-time NOC status badge
This commit is contained in:
@@ -70,9 +70,10 @@ This demonstrates:
|
||||
|
||||
## 🔴 Live System Status
|
||||
|
||||

|
||||

|
||||

|
||||
|
||||

|
||||

|
||||
|
||||
---
|
||||
# 🧠 Featured System — Ced’s NOC (Network Operations Center)
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"label": "Ced's NOC",
|
||||
"message": "All Systems Online | 8/8 online | 0 offline",
|
||||
"color": "brightgreen"
|
||||
}
|
||||
+20
-20
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"nocName": "Ced's NOC",
|
||||
"status": "All Systems Online",
|
||||
"lastUpdated": "2026-04-26 16:03:47",
|
||||
"lastUpdated": "2026-04-26 17:50:50",
|
||||
"summary": {
|
||||
"nodes": "12+",
|
||||
"services": "8/8",
|
||||
@@ -16,11 +16,11 @@
|
||||
"type": "Virtualization Platform",
|
||||
"address": "10.10.30.250:8006",
|
||||
"status": "Online",
|
||||
"severity": "Degraded",
|
||||
"severity": "Healthy",
|
||||
"layer": "Core Infrastructure",
|
||||
"label": "Hypervisor",
|
||||
"latency": "52 ms",
|
||||
"lastCheck": "2026-04-26 16:03:47"
|
||||
"latency": "4 ms",
|
||||
"lastCheck": "2026-04-26 17:50:50"
|
||||
},
|
||||
{
|
||||
"name": "TrueNAS",
|
||||
@@ -30,8 +30,8 @@
|
||||
"severity": "Healthy",
|
||||
"layer": "Storage",
|
||||
"label": "NAS",
|
||||
"latency": "1 ms",
|
||||
"lastCheck": "2026-04-26 16:03:47"
|
||||
"latency": "0 ms",
|
||||
"lastCheck": "2026-04-26 17:50:50"
|
||||
},
|
||||
{
|
||||
"name": "Nginx Proxy Manager",
|
||||
@@ -41,8 +41,8 @@
|
||||
"severity": "Healthy",
|
||||
"layer": "Access Layer",
|
||||
"label": "Proxy",
|
||||
"latency": "0 ms",
|
||||
"lastCheck": "2026-04-26 16:03:47"
|
||||
"latency": "3 ms",
|
||||
"lastCheck": "2026-04-26 17:50:50"
|
||||
},
|
||||
{
|
||||
"name": "Dashy",
|
||||
@@ -52,8 +52,8 @@
|
||||
"severity": "Healthy",
|
||||
"layer": "Dashboard",
|
||||
"label": "Portal",
|
||||
"latency": "13 ms",
|
||||
"lastCheck": "2026-04-26 16:03:47"
|
||||
"latency": "11 ms",
|
||||
"lastCheck": "2026-04-26 17:50:50"
|
||||
},
|
||||
{
|
||||
"name": "Jellyfin",
|
||||
@@ -63,8 +63,8 @@
|
||||
"severity": "Healthy",
|
||||
"layer": "Application Service",
|
||||
"label": "App",
|
||||
"latency": "15 ms",
|
||||
"lastCheck": "2026-04-26 16:03:47"
|
||||
"latency": "0 ms",
|
||||
"lastCheck": "2026-04-26 17:50:50"
|
||||
},
|
||||
{
|
||||
"name": "K3s API",
|
||||
@@ -74,30 +74,30 @@
|
||||
"severity": "Healthy",
|
||||
"layer": "Compute Cluster",
|
||||
"label": "Cluster",
|
||||
"latency": "1 ms",
|
||||
"lastCheck": "2026-04-26 16:03:47"
|
||||
"latency": "0 ms",
|
||||
"lastCheck": "2026-04-26 17:50:50"
|
||||
},
|
||||
{
|
||||
"name": "APRS Home iGate",
|
||||
"type": "RF Edge Gateway",
|
||||
"address": "KJ5JCO-10 / Direwolf KISS 8001",
|
||||
"status": "Online",
|
||||
"severity": "Degraded",
|
||||
"severity": "Critical",
|
||||
"layer": "Edge / RF",
|
||||
"label": "iGate",
|
||||
"latency": "97 ms",
|
||||
"lastCheck": "2026-04-26 16:03:47"
|
||||
"latency": "324 ms",
|
||||
"lastCheck": "2026-04-26 17:50:50"
|
||||
},
|
||||
{
|
||||
"name": "APRS-IS",
|
||||
"type": "APRS Internet Service",
|
||||
"address": "noam.aprs2.net:14580",
|
||||
"status": "Online",
|
||||
"severity": "Healthy",
|
||||
"severity": "Degraded",
|
||||
"layer": "Edge / RF",
|
||||
"label": "External",
|
||||
"latency": "42 ms",
|
||||
"lastCheck": "2026-04-26 16:03:47"
|
||||
"latency": "98 ms",
|
||||
"lastCheck": "2026-04-26 17:50:50"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parent.parent
|
||||
NOC_FILE = ROOT / "data" / "noc-status.json"
|
||||
BADGE_FILE = ROOT / "data" / "noc-badge.json"
|
||||
|
||||
with open(NOC_FILE, "r", encoding="utf-8") as file:
|
||||
data = json.load(file)
|
||||
|
||||
status = data.get("status", "Unknown")
|
||||
summary = data.get("summary", {})
|
||||
|
||||
online = summary.get("online", "?")
|
||||
offline = summary.get("offline", "?")
|
||||
services = summary.get("services", f"{online}/?")
|
||||
|
||||
if status == "All Systems Online":
|
||||
color = "brightgreen"
|
||||
elif status == "Degraded":
|
||||
color = "yellow"
|
||||
else:
|
||||
color = "red"
|
||||
|
||||
badge = {
|
||||
"schemaVersion": 1,
|
||||
"label": "Ced's NOC",
|
||||
"message": f"{status} | {services} online | {offline} offline",
|
||||
"color": color
|
||||
}
|
||||
|
||||
BADGE_FILE.parent.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
with open(BADGE_FILE, "w", encoding="utf-8") as file:
|
||||
json.dump(badge, file, indent=2)
|
||||
|
||||
print(f"NOC badge written to {BADGE_FILE}")
|
||||
print(badge["message"])
|
||||
Reference in New Issue
Block a user