diff --git a/config/agents.yaml b/config/agents.yaml index 40d2039..2c76bfb 100644 --- a/config/agents.yaml +++ b/config/agents.yaml @@ -13,7 +13,7 @@ agents: display_name: "小小莫" jid: "xxm@yoin.fun" platform: windows - host: "192.168.1.248" + host: "192.168.1.16" bot_type: xmpp provider: volcengine services: diff --git a/gateway/scripts/agents_daily_health.py b/gateway/scripts/agents_daily_health.py index b32d1a0..b90ca8d 100644 --- a/gateway/scripts/agents_daily_health.py +++ b/gateway/scripts/agents_daily_health.py @@ -37,8 +37,8 @@ SERVICES = [ {"name": "hermes_gateway_mohe", "host": "127.0.0.1", "port": 8642, "health_url": "http://127.0.0.1:8642/v1/health", "depends_on": [], "desc": "莫荷 AI Gateway"}, {"name": "hermes_gateway_zhiwei","host": "127.0.0.1", "port": 8643, "health_url": "http://127.0.0.1:8643/v1/health", "depends_on": [], "desc": "知微 AI Gateway"}, {"name": "wechat_bridge", "host": "127.0.0.1", "port": 3001, "health_url": None, "depends_on": [], "desc": "微信桥接 Docker"}, - {"name": "xmpp_bot_xxm", "host": "192.168.1.248", "port": 5807, "health_url": "http://192.168.1.248:5807/health", "depends_on": ["ejabberd"],"desc": "小小莫 XMPP Bot"}, - {"name": "article_processor", "host": "192.168.1.248", "port": 5810, "health_url": "http://192.168.1.248:5810/health", "depends_on": [], "desc": "文章抓取服务"}, + {"name": "xmpp_bot_xxm", "host": "192.168.1.16", "port": 5807, "health_url": "http://192.168.1.16:5807/health", "depends_on": ["ejabberd"],"desc": "小小莫 XMPP Bot"}, + {"name": "article_processor", "host": "192.168.1.16", "port": 5810, "health_url": "http://192.168.1.16:5810/health", "depends_on": [], "desc": "文章抓取服务"}, ] # ── 期望的定时任务(crontab 条目关键字)────────────────── diff --git a/gateway/scripts/agents_health_check.py b/gateway/scripts/agents_health_check.py index cc7aed5..f768497 100644 --- a/gateway/scripts/agents_health_check.py +++ b/gateway/scripts/agents_health_check.py @@ -79,18 +79,18 @@ SERVICES = [ # === 远程服务(跨网 HTTP 检查)=== { "name": "xmpp_bot_xxm", - "host": "192.168.1.248", + "host": "192.168.1.16", "port": 5807, - "health_url": "http://192.168.1.248:5807/health", + "health_url": "http://192.168.1.16:5807/health", "fix_cmd": None, # 远程服务无法自动修复 "remote": True, "critical": True, }, { "name": "article_processor", - "host": "192.168.1.248", + "host": "192.168.1.16", "port": 5810, - "health_url": "http://192.168.1.248:5810/health", + "health_url": "http://192.168.1.16:5810/health", "fix_cmd": None, "remote": True, "critical": False, diff --git a/gateway/scripts/dashboard.py b/gateway/scripts/dashboard.py index 7a04000..d0a82a7 100644 --- a/gateway/scripts/dashboard.py +++ b/gateway/scripts/dashboard.py @@ -22,7 +22,7 @@ TEMPLATES_DIR = _SCRIPT_DIR / "templates" CONFIG_DIR = _PROJECT_DIR / "config" LOGS_DIR = _GATEWAY_DIR / "logs" TEMP_DIR = _GATEWAY_DIR / "temp" -XMPP_BRIDGE_URL = os.environ.get("XMPP_BRIDGE_URL", "http://192.168.1.248:5807") +XMPP_BRIDGE_URL = os.environ.get("XMPP_BRIDGE_URL", "http://192.168.1.16:5807") EJABBERD_HOST = os.environ.get("EJABBERD_HOST", "192.168.1.246") # On Linux (mohe), dashboard runs from systemd with different paths. Support explicit override. @@ -102,7 +102,7 @@ def _default_agents(): return [ { "id": "agent-001", "name": "R&D Assistant", "display_name": "xxm", - "jid": "xxm@yoin.fun", "platform": "windows", "host": "192.168.1.248", + "jid": "xxm@yoin.fun", "platform": "windows", "host": "192.168.1.16", "bot_type": "xmpp", "provider": "volcengine", "services": [{"type": "xmpp_bot", "port": 5807}], }, @@ -286,7 +286,7 @@ def api_agents(): # --- Local process (Windows only) --- local_pid = None xmpp_connected = False - if platform == "windows" and host in ("192.168.1.248", "127.0.0.1", "localhost"): + if platform == "windows" and host in ("192.168.1.16", "127.0.0.1", "localhost"): for proc in local_procs: if "xmpp_bot.py" in proc.get("cmdline", ""): local_pid = proc["pid"] @@ -304,7 +304,7 @@ def api_agents(): status_reason = "无法检测 XMPP 状态" elif xmpp_in_ejabberd is True: status_reason = "OK" - if platform == "windows" and host in ("192.168.1.248", "127.0.0.1", "localhost"): + if platform == "windows" and host in ("192.168.1.16", "127.0.0.1", "localhost"): if status_reason == "OK": status_reason = "OK" elif xmpp_connected: @@ -358,7 +358,7 @@ def api_agents(): status = "online" elif xmpp_in_ejabberd is False: status = "offline" - elif platform == "windows" and host in ("192.168.1.248", "127.0.0.1", "localhost"): + elif platform == "windows" and host in ("192.168.1.16", "127.0.0.1", "localhost"): if xmpp_connected: status = "online" elif local_pid: @@ -392,7 +392,7 @@ def api_agents(): "message_count_5min": message_count, "errors": 0, "offline_checks": _offline_counter.get(agent_id, 0), - "restartable": (platform == "windows" and host in ("192.168.1.248", "127.0.0.1", "localhost")) or + "restartable": (platform == "windows" and host in ("192.168.1.16", "127.0.0.1", "localhost")) or (platform == "linux" and host in LOCAL_LINUX_HOSTS), "services": services, }) @@ -418,7 +418,7 @@ def _try_auto_recover(agent): return # Windows local → subprocess - if platform != "windows" or host not in ("192.168.1.248", "127.0.0.1", "localhost"): + if platform != "windows" or host not in ("192.168.1.16", "127.0.0.1", "localhost"): return for svc in agent.get("services", []): script_name = SCRIPT_NAMES.get(svc.get("type", "")) @@ -561,7 +561,7 @@ PLATFORM_SERVICES = [ "host": "192.168.1.246", "port": 3001}, {"id": "article_processor", "name": "文章抓取服务 (5810)", "type": "wechat-fetch", "desc": "fetches wechat article content + OCR (DrissionPage)", - "host": "192.168.1.248", "health_url": "http://192.168.1.248:5810/health"}, + "host": "192.168.1.16", "health_url": "http://192.168.1.16:5810/health"}, ] @@ -810,7 +810,7 @@ def api_platform(): def api_article_processor_logs(): """Proxy logs from article-processor service on Windows.""" try: - req = urllib.request.Request("http://192.168.1.248:5810/logs?lines=200") + req = urllib.request.Request("http://192.168.1.16:5810/logs?lines=200") with urllib.request.urlopen(req, timeout=5) as resp: data = json.loads(resp.read()) lines = data.get("lines", []) @@ -960,7 +960,7 @@ def api_services(): "watchdog": True, "pid_lock": True, "type": "core", "depends_on": ["ejabberd"]} services.append(svc1) # article_processor (跨平台:通过 PLATFORM_SERVICES 中的 health_url) - ap_url = "http://192.168.1.248:5810/health" + ap_url = "http://192.168.1.16:5810/health" svc2 = {"name": "article_processor", "port": 5810, "health": _health_status(ap_url), "watchdog": True, "pid_lock": False, "type": "bridge", "depends_on": []} services.append(svc2) @@ -1467,7 +1467,7 @@ def api_usage_refresh(): log.info("usage: starting Kimi collector via SSH") kimi_cmd = [ "ssh", "-o", "StrictHostKeyChecking=no", "-o", "ConnectTimeout=10", - "-o", "BatchMode=yes", "hmo@192.168.1.248", + "-o", "BatchMode=yes", "hmo@192.168.1.16", r'"C:\Users\hmo\AppData\Local\Programs\Python\Python310\python.exe" "D:\F\NewI\opencode\daily-workspace\projects\AgentsMeeting\gateway\scripts\usage_collector_kimi.py"' ] proc2 = subprocess.run(kimi_cmd, capture_output=True, text=True, timeout=60) @@ -1478,7 +1478,7 @@ def api_usage_refresh(): # 3. scp Kimi 结果回 246 scp_cmd = [ "scp", "-o", "StrictHostKeyChecking=no", "-o", "ConnectTimeout=10", - "hmo@192.168.1.248:D:/F/NewI/opencode/daily-workspace/projects/AgentsMeeting/gateway/temp/usage_stats_kimi.json", + "hmo@192.168.1.16:D:/F/NewI/opencode/daily-workspace/projects/AgentsMeeting/gateway/temp/usage_stats_kimi.json", str(TEMP_DIR / "usage_stats_kimi.json") ] proc3 = subprocess.run(scp_cmd, capture_output=True, timeout=15) @@ -1489,7 +1489,7 @@ def api_usage_refresh(): log.info("usage: starting SenseNova collector via SSH") sn_cmd = [ "ssh", "-o", "StrictHostKeyChecking=no", "-o", "ConnectTimeout=10", - "-o", "BatchMode=yes", "hmo@192.168.1.248", + "-o", "BatchMode=yes", "hmo@192.168.1.16", r'"C:\Users\hmo\AppData\Local\Programs\Python\Python310\python.exe" "D:\F\NewI\opencode\daily-workspace\projects\AgentsMeeting\gateway\scripts\usage_collector_sensenova.py"' ] proc4 = subprocess.run(sn_cmd, capture_output=True, text=True, timeout=90) @@ -1498,7 +1498,7 @@ def api_usage_refresh(): log.warning(f"usage_sensenova stderr: {proc4.stderr[-300:]}") scp4 = subprocess.run([ "scp", "-o", "StrictHostKeyChecking=no", "-o", "ConnectTimeout=10", - "hmo@192.168.1.248:D:/F/NewI/opencode/daily-workspace/projects/AgentsMeeting/gateway/temp/usage_stats_sensenova.json", + "hmo@192.168.1.16:D:/F/NewI/opencode/daily-workspace/projects/AgentsMeeting/gateway/temp/usage_stats_sensenova.json", str(TEMP_DIR / "usage_stats_sensenova.json") ], capture_output=True, timeout=15) log.info(f"usage: SenseNova scp done (rc={scp4.returncode})")