用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/Turnipnator/Betfair_Bot --skill healthcheck命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | healthcheck |
| description | Run a comprehensive health check on the Betfair trading bot |
Run a comprehensive health check on the betfair-bot. Work through each section systematically and provide a summary dashboard at the end.
sqlite3 is not installed inside the container. To query the DB, copy it out first:
docker cp betfair-bot:/app/data/betfair_bot.db /tmp/bf.db && sqlite3 /tmp/bf.db "<query>"betfair-bot running and healthy?ssh -i ~/.ssh/id_ed25519_vps root@149.102.144.190 "docker ps --format '{{.Names}}\t{{.Status}}\t{{.RunningFor}}' | grep betfair && docker inspect -f '{{.State.StartedAt}}' betfair-bot"
ssh -i ~/.ssh/id_ed25519_vps root@149.102.144.190 "docker compose -f /opt/betfair-bot/docker-compose.yml logs --tail 100 betfair-bot 2>&1"
ssh -i ~/.ssh/id_ed25519_vps root@149.102.144.190 "docker logs betfair-bot 2>&1 | grep -iE 'error|warn|fail|session|expired' | tail -30"
ssh -i ~/.ssh/id_ed25519_vps root@149.102.144.190 "docker logs betfair-bot --since 1h 2>&1 | grep -c 'scan_markets.*executed successfully'"
ssh -i ~/.ssh/id_ed25519_vps root@149.102.144.190 "docker cp betfair-bot:/app/data/betfair_bot.db /tmp/bf.db && sqlite3 /tmp/bf.db 'SELECT id, strategy, selection_name, matched_odds, stake, result, profit_loss, placed_at FROM bets ORDER BY placed_at DESC LIMIT 10;'"
ssh -i ~/.ssh/id_ed25519_vps root@149.102.144.190 "docker cp betfair-bot:/app/data/betfair_bot.db /tmp/bf.db && sqlite3 /tmp/bf.db 'SELECT strategy, status, result, COUNT(*), ROUND(SUM(profit_loss),2) FROM bets WHERE placed_at > datetime(\"now\",\"-14 days\") GROUP BY strategy, status, result;'"
ssh -i ~/.ssh/id_ed25519_vps root@149.102.144.190 "free -h && echo '---' && df -h / && echo '---' && top -bn1 | head -12"
ssh -i ~/.ssh/id_ed25519_vps root@149.102.144.190 "grep -E 'ENABLE_|MODE|STRATEGY|STAKE|STREAMING' /opt/betfair-bot/.env 2>/dev/null | head -20"
The bot can appear "healthy" in docker ps while its Betfair session has silently died.
Symptoms: container up, scheduler running, no exceptions — but no bets being placed.
Run these checks every time:
# (a) Count recent "not logged in" warnings. Should be 0 since 2026-04-20 fix
# (re-login now auto-recovers within 15 mins). >3 in the last hour = investigate.
ssh -i ~/.ssh/id_ed25519_vps root@149.102.144.190 "docker logs betfair-bot --since 1h 2>&1 | grep -c 'not logged in to Betfair'"
# (b) Confirm a recent successful login or keep-alive
ssh -i ~/.ssh/id_ed25519_vps root@149.102.144.190 "docker logs betfair-bot --since 2h 2>&1 | grep -iE 'Successfully logged into Betfair|Session keep-alive successful|attempting re-login' | tail -10"
# (c) Days since last bet placed — flag if bot is up but no bets for >48h
ssh -i ~/.ssh/id_ed25519_vps root@149.102.144.190 "docker cp betfair-bot:/app/data/betfair_bot.db /tmp/bf.db && sqlite3 /tmp/bf.db \"SELECT MAX(placed_at), CAST((julianday('now') - julianday(MAX(placed_at))) AS INTEGER) AS days_ago FROM bets;\""
Interpretation:
not logged in warnings recurring AND no attempting re-login messages = auto-recovery broken, container restart neededattempting re-login messages present = session dropped but recovered (working as designed)Provide prioritised recommendations:
Present a quick status summary table:
| Check | Status | Notes |
|---|---|---|
| Bot Running | ?/? | |
| Database Running | ?/? | |
| Logs Healthy | ?/?/? | |
| Markets Active | ?/? | |
| Resources OK | ?/?/? | |
| Session Valid | ?/? | |
| Strategy Edge | ?/?/? |
Traffic light summary: ? All good / ? Minor issues / ? Needs attention