21 lines
927 B
Python
21 lines
927 B
Python
#!/usr/bin/env python3
|
|
import json, sys, 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=40, allow_agent=False, look_for_keys=False)
|
|
cmd = r'''python3 - <<'PY'
|
|
import sqlite3, json
|
|
c=sqlite3.connect("/opt/douyinWEB/backend/data/monitor.db")
|
|
for k in ["shorts_oauth_redirect_uri","dy_cookie_updated_at"]:
|
|
v=json.loads(c.execute("select value from kv_settings where key=?",(k,)).fetchone()[0])
|
|
print(k, v)
|
|
print("rooms", c.execute("select count(*) from rooms").fetchone()[0])
|
|
print("shorts", c.execute("select count(*) from shorts_channels").fetchone()[0])
|
|
print("assign", c.execute("select count(*) from yt_assign_groups").fetchone()[0])
|
|
c.close()
|
|
PY'''
|
|
_i,o,e=c.exec_command(cmd, timeout=30)
|
|
print((o.read()+e.read()).decode("utf-8","replace"))
|
|
c.close()
|