feat: lifecycle telegram_via routing and lifecycle details 1.2.12-SAC

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
PTah
2026-05-31 12:25:52 +10:00
parent e1a37b8f89
commit cf4e3b2e90
3 changed files with 35 additions and 4 deletions
+5 -3
View File
@@ -7,7 +7,7 @@ IFS=$'\n\t'
# ============================================
CONFIG_FILE="/etc/ssh-monitor.conf"
SSH_MONITOR_VERSION="1.2.11-SAC"
SSH_MONITOR_VERSION="1.2.12-SAC"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
if [ -f "$SCRIPT_DIR/sac-client.sh" ]; then
@@ -1963,7 +1963,9 @@ send_startup_notification() {
message="${message}❤️ Heartbeat будет отправляться каждые 12 часов"$'\n'
message="${message}📢 Каналы уведомлений (все по списку): $(notify_chain_human)"
notify_or_sac "agent.lifecycle" "info" "Мониторинг запущен" "ssh-monitor started" "$message"
local lifecycle_details
lifecycle_details='{"lifecycle":"started","trigger":"boot"}'
notify_or_sac "agent.lifecycle" "info" "Мониторинг запущен" "ssh-monitor started" "$message" "$lifecycle_details"
write_log "Скрипт мониторинга запущен (белый список: $whitelist_count записей)"
}
@@ -1976,7 +1978,7 @@ send_shutdown_notification() {
local message=" ⚠️ СКРИПТ МОНИТОРИНГА ОСТАНОВЛЕН "$'\n'
message="${message}🕐 Время остановки: ${timestamp}"
notify_or_sac "agent.lifecycle" "warning" "Мониторинг остановлен" "ssh-monitor stopped" "$message"
notify_or_sac "agent.lifecycle" "info" "Мониторинг остановлен" "ssh-monitor stopped" "$message" '{"lifecycle":"stopped","trigger":"shutdown"}'
write_log "Скрипт мониторинга остановлен"
}