自检循环2: R01 Gateway监控 + 服务树扩展
- 新增gateway_mohe:8642 + gateway_zhiwei:8643到服务注册表 - 新增api_services返回2个Gateway的健康状态 - I功能树+J拓扑自动包含Gateway节点 - PRD R01状态: ❌→🔄(监控已加,auto-restart待systemd)
This commit is contained in:
@@ -629,6 +629,13 @@ def api_services():
|
||||
online = _ejabberd_online_jids()
|
||||
services.append({"name": "ejabberd", "port": 5222, "health": {"ok": len(online) > 0},
|
||||
"watchdog": True, "pid_lock": False, "type": "infra", "depends_on": []})
|
||||
# remote gateways (R01 monitoring)
|
||||
g1 = {"name": "gateway_mohe", "port": 8642, "health": _health_status("http://192.168.1.246:8642/v1/health"),
|
||||
"watchdog": False, "pid_lock": False, "type": "gateway", "depends_on": ["ejabberd"]}
|
||||
services.append(g1)
|
||||
g2 = {"name": "gateway_zhiwei", "port": 8643, "health": _health_status("http://192.168.1.246:8643/v1/health"),
|
||||
"watchdog": False, "pid_lock": False, "type": "gateway", "depends_on": ["ejabberd"]}
|
||||
services.append(g2)
|
||||
# 统计
|
||||
watched = sum(1 for s in services if s.get("watchdog"))
|
||||
return jsonify({"ok": True, "services": services, "watched": watched, "total": len(services)})
|
||||
|
||||
@@ -53,4 +53,30 @@ SERVICES = [
|
||||
"log_files": lambda: [],
|
||||
"description": "AgentsMeeting 管理门户",
|
||||
},
|
||||
{
|
||||
"name": "gateway_mohe",
|
||||
"script": None,
|
||||
"args": [],
|
||||
"workdir": None,
|
||||
"pid_file": None,
|
||||
"port": 8642,
|
||||
"health_url": "http://192.168.1.246:8642/v1/health",
|
||||
"accept_401": True, # may need auth
|
||||
"depends_on": ["ejabberd"],
|
||||
"log_files": lambda: [],
|
||||
"description": "Hermes Gateway (mohe@yoin.fun)",
|
||||
},
|
||||
{
|
||||
"name": "gateway_zhiwei",
|
||||
"script": None,
|
||||
"args": [],
|
||||
"workdir": None,
|
||||
"pid_file": None,
|
||||
"port": 8643,
|
||||
"health_url": "http://192.168.1.246:8643/v1/health",
|
||||
"accept_401": True,
|
||||
"depends_on": ["ejabberd"],
|
||||
"log_files": lambda: [],
|
||||
"description": "Hermes Gateway (zhiwei@yoin.fun)",
|
||||
},
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user