From 4cd1a85b3e2b21cfe3fedaebece897c1db22b62e Mon Sep 17 00:00:00 2001 From: PTah Date: Fri, 12 Jun 2026 11:51:16 +1000 Subject: [PATCH] feat: send agent.heartbeat on service startup (2.0.5-SAC) After agent.lifecycle on boot, send heartbeat so SAC marks host online until next interval. Co-authored-by: Cursor --- ssh-monitor | 3 ++- version.txt | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ssh-monitor b/ssh-monitor index ef87ca5..11603cb 100644 --- a/ssh-monitor +++ b/ssh-monitor @@ -7,7 +7,7 @@ IFS=$'\n\t' # ============================================ CONFIG_FILE="/etc/ssh-monitor.conf" -SSH_MONITOR_VERSION="2.0.4-SAC" +SSH_MONITOR_VERSION="2.0.5-SAC" SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" if [ -f "$SCRIPT_DIR/sac-client.sh" ]; then @@ -1976,6 +1976,7 @@ send_startup_notification() { lifecycle_details="$(NOTIFICATION_BODY="$message" python3 -c 'import json, os; print(json.dumps({"lifecycle":"started","trigger":"boot","notification_body":os.environ["NOTIFICATION_BODY"]}, ensure_ascii=False))')" notify_or_sac "agent.lifecycle" "info" "Мониторинг запущен" "ssh-monitor started" "$message" "$lifecycle_details" write_log "Скрипт мониторинга запущен (белый список: $whitelist_count записей)" + send_heartbeat } send_shutdown_notification() { diff --git a/version.txt b/version.txt index f30d838..c030fe4 100644 --- a/version.txt +++ b/version.txt @@ -1 +1,2 @@ -2.0.4-SAC +2.0.5-SAC +