自检循环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)})
|
||||
|
||||
Reference in New Issue
Block a user