# -*- coding: utf-8 -*- import sys, paramiko sys.stdout.reconfigure(encoding="utf-8", errors="replace") MASTER=paramiko.SSHClient(); MASTER.set_missing_host_key_policy(paramiko.AutoAddPolicy()) MASTER.connect('107.172.77.34',22,'root','Xiao4669805',timeout=45,allow_agent=False,look_for_keys=False) REMOTE=r''' set +e echo '=== master logs for @3 / proxy / locked ===' docker logs --since 6h frp-panel 2>&1 | grep -iE 'pve-ubuntu@3|database is locked|push proxy|new proxy|pull.*client|rpc error' | tail -60 echo echo '=== wal / db busy ===' ls -lah /opt/frp-panel/ lsof /opt/frp-panel/data.db* 2>/dev/null | head -20 echo echo '=== try clientsstatus protobuf shapes ===' TOKEN=$(curl -sS -X POST 'http://127.0.0.1:9000/api/v1/auth/login' -H 'Content-Type: application/json' -d '{"username":"hackrobot","password":"Xiao4669805@"}' | python3 -c "import sys,json;print(json.load(sys.stdin)['body']['token'])") python3 - <', d.get('code'), d.get('msg'), str(d.get('body'))[:300]) except Exception as e: print(b, 'ERR', e) # proxy list_configs + get working status endpoints seen in UI logs for path,body in [ ("/api/v1/proxy/list_configs",{"page":1,"page_size":20,"keyword":""}), ("/api/v1/proxy/get_working_status",{}), ("/api/v1/proxy/working_status",{}), ("/api/v1/proxy/get_statuses",{}), ("/api/v1/proxy/statuses",{}), ("/api/v1/server/get_working_status",{"server_id":"hackrobot.s.vps"}), ("/api/v1/client/get_working_status",{"client_id":"hackrobot.c.pve-ubuntu@3"}), ]: req=urllib.request.Request(f"http://127.0.0.1:9000{path}", data=json.dumps(body).encode(), headers=H, method='POST') try: with urllib.request.urlopen(req,timeout=20) as r: raw=r.read().decode(); d=json.loads(raw) print(path, '->', d.get('code'), d.get('msg'), str(d)[:500]) except Exception as e: print(path, type(e).__name__, e) PY ''' _,o,e=MASTER.exec_command(REMOTE,timeout=120) print(o.read().decode('utf-8','replace')) err=e.read().decode('utf-8','replace') if err.strip(): print('STDERR', err[-1000:]) MASTER.close()