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

16 lines
761 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)
_, o, e = c.exec_command(
"curl -sS -o /dev/null -w '%{http_code}\\n' --connect-timeout 2 http://127.0.0.1:9211/; "
"curl -sS -o /dev/null -w 'follow:%{http_code}\\n' --connect-timeout 2 -L http://127.0.0.1:9211/; "
"curl -sS -m 8 -o /dev/null -w 'https:%{http_code}\\n' https://dylive.nomadro.com/neko/12/; "
"docker inspect douyinweb-neko-12 --format '{{.State.Status}} {{.State.Health.Status}} {{json .NetworkSettings.Ports}}'",
timeout=30,
)
print((o.read() + e.read()).decode("utf-8", "replace"))
c.close()