douyinWEB/scripts/_check_workers.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

28 lines
995 B
Python

# -*- coding: utf-8 -*-
import paramiko
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)
script = r"""
import json, urllib.request
h = json.loads(urllib.request.urlopen('http://127.0.0.1:8014/api/health', timeout=15).read())
print('youtube_monitor', json.dumps(h.get('youtube_monitor'), ensure_ascii=False)[:250])
for path in ['/api/tiktok/status', '/api/x/clips/status']:
try:
r = urllib.request.urlopen('http://127.0.0.1:8014' + path, timeout=10)
d = json.loads(r.read())
print(path, 'running=', d.get('running'), 'err=', (d.get('last_error') or '')[:60])
except Exception as e:
print(path, 'ERR', e)
"""
sftp = c.open_sftp()
with sftp.file("/tmp/h2.py", "w") as f:
f.write(script)
sftp.close()
_, o, e = c.exec_command("python3 /tmp/h2.py", timeout=60)
print(o.read().decode("utf-8", "replace"))
c.close()