diff --git a/sac-client.sh b/sac-client.sh index 6554f6f..6ee6a25 100644 --- a/sac-client.sh +++ b/sac-client.sh @@ -292,6 +292,10 @@ print(json.dumps(out) if out else "") PY } +sac_is_heartbeat_only_event() { + [ "${1:-}" = "agent.heartbeat" ] +} + # notify_or_sac type severity title summary telegram_message [details_json] notify_or_sac() { local event_type="$1" @@ -307,6 +311,22 @@ notify_or_sac() { local mode mode="$(sac_normalize_mode "${UseSAC:-off}")" + # Периодический heartbeat — только SAC (браузер), без Telegram/email в любом режиме. + if sac_is_heartbeat_only_event "$event_type"; then + case "$mode" in + off) + return 0 + ;; + exclusive|dual|fallback) + sac_send_event "$event_type" "$severity" "$title" "$summary" "$details_json" + return $? + ;; + *) + return 0 + ;; + esac + fi + case "$mode" in off) notify_send "$telegram_message" diff --git a/ssh-monitor b/ssh-monitor index 8b6d5f3..6a86500 100644 --- a/ssh-monitor +++ b/ssh-monitor @@ -7,7 +7,7 @@ IFS=$'\n\t' # ============================================ CONFIG_FILE="/etc/ssh-monitor.conf" -SSH_MONITOR_VERSION="1.2.2-SAC" +SSH_MONITOR_VERSION="1.2.3-SAC" SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" if [ -f "$SCRIPT_DIR/sac-client.sh" ]; then