Files
Yuri Yaryshev c5014e8a99
All checks were successful
ci / test (push) Successful in 54s
ci / deploy (push) Successful in 2m7s
Монитор: порог диска 70%, второй этап - диагностика Claude в треде алерта
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-30 06:22:38 +03:00

13 lines
722 B
Bash

#!/usr/bin/env bash
# Установка мониторинга на сервере (от root): ./install.sh
set -euo pipefail
D=/y/services/khb-monitor
mkdir -p "$D"
install -m 755 "$(dirname "$0")/monitor.sh" "$D/monitor.sh"
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"