douyinWEB/scripts/_diag_neko3_ports.py
2026-09-13 22:10:49 -05:00

36 lines
1.1 KiB
Python

#!/usr/bin/env python3
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=45, allow_agent=False, look_for_keys=False)
_i, o, e = c.exec_command(
r"""
set +e
docker ps -a --filter name=douyinweb-neko --format '{{.Names}} {{.Status}} {{.Ports}}'
echo '--- inspect 3 ports ---'
docker inspect douyinweb-neko-3 --format '{{json .HostConfig.PortBindings}}'
echo
docker inspect douyinweb-neko-3 --format '{{json .NetworkSettings.Ports}}'
echo
echo '--- logs ---'
docker logs --tail 40 douyinweb-neko-3 2>&1
echo '--- compose ---'
ls -la /opt/douyinWEB/backend/data/neko/ 2>/dev/null | head
head -80 /opt/douyinWEB/backend/data/neko/docker-compose.yml 2>/dev/null | head -80
echo '--- ss 920 ---'
ss -lntp | grep 920 || echo none
echo '--- dylive caddy neko3 ---'
grep -A5 'handle_path /neko/3' /etc/caddy/sites/dylive.nomadro.com.caddy | head -10
""",
timeout=60,
)
print((o.read() + e.read()).decode("utf-8", "replace"))
c.close()