43 lines
1.0 KiB
Python
43 lines
1.0 KiB
Python
#!/usr/bin/env python3
|
|
"""Check dylive neko fleet after WP stop."""
|
|
from __future__ import annotations
|
|
|
|
import sys
|
|
import time
|
|
|
|
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=50,
|
|
allow_agent=False,
|
|
look_for_keys=False,
|
|
banner_timeout=180,
|
|
)
|
|
_i, o, e = c.exec_command(
|
|
r"""
|
|
set +e
|
|
docker ps -a --filter name=douyinweb-neko --format '{{.Names}}\t{{.Status}}'
|
|
echo '---'
|
|
free -m | head -2
|
|
# which assign has neko 12 / 19
|
|
cd /opt/douyinWEB/backend
|
|
./.venv/bin/python - <<'PY'
|
|
from app import yt_assign_db
|
|
for g in yt_assign_db.list_groups(include_urls=False, include_secret=False):
|
|
nid = g.get('neko_instance_id')
|
|
if nid in (12, 18, 19) or g.get('neko_enabled'):
|
|
print(g.get('name'), 'neko', nid, 'en', g.get('neko_enabled'), 'cat', g.get('category'))
|
|
PY
|
|
""",
|
|
timeout=60,
|
|
)
|
|
print((o.read() + e.read()).decode("utf-8", "replace"))
|
|
c.close()
|