mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 09:12:45 +01:00
Merge pull request #15009 from Security-Onion-Solutions/reyesj2/ea-alerter
so-elastic-agent-monitor
This commit is contained in:
@@ -19,7 +19,7 @@
|
|||||||
"enabled": true,
|
"enabled": true,
|
||||||
"vars": {
|
"vars": {
|
||||||
"paths": [
|
"paths": [
|
||||||
"/opt/so/log/agents/agent-monitor-*.log"
|
"/opt/so/log/agents/agent-monitor.log"
|
||||||
],
|
],
|
||||||
"data_stream.dataset": "agent-monitor",
|
"data_stream.dataset": "agent-monitor",
|
||||||
"pipeline": "elasticagent.monitor",
|
"pipeline": "elasticagent.monitor",
|
||||||
|
|||||||
@@ -145,6 +145,11 @@ main() {
|
|||||||
|
|
||||||
offline_hours=$(calculate_offline_hours "$last_checkin")
|
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 \
|
log_entry=$(echo 'null' | jq -c \
|
||||||
--arg ts "$current_timestamp" \
|
--arg ts "$current_timestamp" \
|
||||||
--arg id "$agent_id" \
|
--arg id "$agent_id" \
|
||||||
|
|||||||
Reference in New Issue
Block a user