Merge pull request #15009 from Security-Onion-Solutions/reyesj2/ea-alerter

so-elastic-agent-monitor
This commit is contained in:
Jorge Reyes
2025-09-09 17:00:39 -05:00
committed by GitHub
2 changed files with 6 additions and 1 deletions

View File

@@ -19,7 +19,7 @@
"enabled": true,
"vars": {
"paths": [
"/opt/so/log/agents/agent-monitor-*.log"
"/opt/so/log/agents/agent-monitor.log"
],
"data_stream.dataset": "agent-monitor",
"pipeline": "elasticagent.monitor",

View File

@@ -145,6 +145,11 @@ main() {
offline_hours=$(calculate_offline_hours "$last_checkin")
if [ "$offline_hours" -lt "$OFFLINE_THRESHOLD_HOURS" ]; then
log_message "INFO" "${agent_hostname^^} has been offline for ${offline_hours}h (threshold: ${OFFLINE_THRESHOLD_HOURS}h). Not logging ${agent_status^^} agent until it reaches threshold"
continue
fi
log_entry=$(echo 'null' | jq -c \
--arg ts "$current_timestamp" \
--arg id "$agent_id" \