douyinWEB/scripts/_diag_xclips_status.py
eric d409e416da Ship physical dual-edge stack, Studio CDP live metrics, and ops tooling.
Capture Neko/WG/network hubs, Studio viewer charts, physical deploy docs, and one-shot scripts so VPS vs physical can be toggled later without losing WIP.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-04 22:42:40 -05:00

37 lines
1.1 KiB
Python

# -*- coding: utf-8 -*-
from __future__ import annotations
import sys
import paramiko
sys.stdout.reconfigure(encoding="utf-8", errors="replace")
c = paramiko.SSHClient()
c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
c.connect("107.173.30.245", 22, "root", "Xiao4669805", timeout=30, allow_agent=False, look_for_keys=False)
def run(cmd: str, timeout: int = 60) -> str:
_, out, err = c.exec_command(cmd, timeout=timeout)
return (out.read() + err.read()).decode("utf-8", "replace").strip()
print("http_code:", run("curl -sS -m 10 -o /tmp/xclips_st.json -w '%{http_code}' http://127.0.0.1:8014/api/x-clips/status"))
print("body:", run("tr -cd '\\11\\12\\15\\40-\\176' < /tmp/xclips_st.json | head -c 800"))
print("journal:")
print(
run(
"journalctl -u douyinweb-api -n 80 --no-pager | tr -cd '\\11\\12\\15\\40-\\176' | tail -n 60"
)
)
print("import_test:")
print(
run(
"cd /opt/douyinWEB && /opt/douyinWEB/backend/.venv/bin/python -c "
"'from backend.app.x_clips_pipeline import x_clips_pipeline; "
"import json; print(json.dumps(x_clips_pipeline.status())[:400])'"
)
)
c.close()