Монитор: порог диска 70%, второй этап - диагностика Claude в треде алерта
All checks were successful
ci / test (push) Successful in 54s
ci / deploy (push) Successful in 2m7s

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-30 06:22:38 +03:00
parent f8ba746233
commit c5014e8a99
4 changed files with 94 additions and 7 deletions

View File

@@ -4,7 +4,9 @@ set -euo pipefail
D=/y/services/khb-monitor
mkdir -p "$D"
install -m 755 "$(dirname "$0")/monitor.sh" "$D/monitor.sh"
[ -f "$D/monitor.conf" ] || printf 'DISK_LIMIT=80\nMEM_AVAIL_MIN_PCT=8\nREMIND_HOURS=6\n' > "$D/monitor.conf"
install -m 755 "$(dirname "$0")/diagnose.sh" "$D/diagnose.sh"
install -m 644 "$(dirname "$0")/diagnose-prompt.md" "$D/diagnose-prompt.md"
[ -f "$D/monitor.conf" ] || printf 'DISK_LIMIT=70\nMEM_AVAIL_MIN_PCT=8\nREMIND_HOURS=6\nDIAG_ENABLED=1\nDIAG_MAX=3\n' > "$D/monitor.conf"
[ -f "$D/expected.txt" ] || docker ps -a --format '{{.Names}}' | sort > "$D/expected.txt"
echo '*/5 * * * * root /y/services/khb-monitor/monitor.sh >> /var/log/khb-monitor.log 2>&1' > /etc/cron.d/khb-monitor
echo "ok"