Merge pull request #10997 from Security-Onion-Solutions/2.4/autoupgrade

Enable Agent Upgrade Check during highstate
This commit is contained in:
Josh Brower
2023-08-09 10:58:26 -04:00
committed by GitHub
2 changed files with 7 additions and 2 deletions

View File

@@ -109,6 +109,11 @@ so-elastic-fleet:
so-elastic-fleet-integrations:
cmd.run:
- name: /usr/sbin/so-elastic-fleet-integration-policy-load
so-elastic-agent-grid-upgrade:
cmd.run:
- name: /usr/sbin/so-elastic-agent-grid-upgrade
- retry: True
{% endif %}
delete_so-elastic-fleet_so-status.disabled:

View File

@@ -14,8 +14,8 @@ fi
RAW_JSON=$(curl -K /opt/so/conf/elasticsearch/curl.config -L "http://localhost:5601/api/fleet/agents?perPage=20&page=1&kuery=policy_id%20%3A%20so-grid-nodes_%2A&showInactive=false&showUpgradeable=true&getStatusSummary=true")
# Check to make sure that the server responded with good data - else, bail from script
CHECKSUM=$(jq -r '.statusSummary.online' <<< "$RAW_JSON")
if [ "$CHECKSUM" -lt 1 ]; then
CHECKSUM=$(jq -r '.page' <<< "$RAW_JSON")
if [ "$CHECKSUM" -ne 1 ]; then
printf "Failed to query for current Grid Agents...\n"
exit 1
fi