12 lines
881 B
Python
12 lines
881 B
Python
import paramiko
|
|
ssh=paramiko.SSHClient(); ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
|
ssh.connect("192.168.10.157", port=22, username="yunhai", password="123456", timeout=20)
|
|
def run(c):
|
|
i,o,e=ssh.exec_command(c); return o.read().decode('utf-8','ignore')+("ERR:"+e.read().decode('utf-8','ignore') if e.read() else "")
|
|
out=run("docker logs --tail 200 cas-sso 2>&1 | grep -n -A 25 '建立 SSO 会话失败\\|createTicketGrantingTicket\\|AbstractTicketException\\|AuthenticationException\\|Cannot\\|Exception' | tail -60")
|
|
print(out if out.strip() else "(no exception traces found)")
|
|
# also check redis ticket registry config
|
|
print("\n=== redis ticket registry config? ===")
|
|
print(run("docker exec cas-sso sh -c 'grep -ri ticket.registry /etc/cas/config/cas.properties 2>/dev/null; grep -ri ticket.registry /app/*.properties 2>/dev/null' || echo none"))
|
|
ssh.close()
|