douyinWEB/scripts/_check_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

21 lines
825 B
Python

import paramiko
HOST = "107.173.30.245"
USER = "root"
PASSWORD = "Xiao4669805"
c = paramiko.SSHClient()
c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
c.connect(HOST, 22, USER, PASSWORD, timeout=30, allow_agent=False, look_for_keys=False)
for cmd in [
"systemctl is-active douyinweb-api douyinweb-web",
"python3 -c \"import sqlite3; c=sqlite3.connect('/opt/douyinWEB/backend/data/monitor.db'); print('channels:', c.execute('select count(*) from shorts_channels').fetchone()[0]); print('rooms:', c.execute('select count(*) from rooms').fetchone()[0]); print('sessions:', c.execute('select count(*) from sessions').fetchone()[0])\"",
]:
_s, out, err = c.exec_command(cmd, timeout=20)
print(out.read().decode().strip())
e = err.read().decode().strip()
if e: print("err:", e[:100])
c.close()