Skip to content

Commit

Permalink
Merge pull request #13537 from Security-Onion-Solutions/fix/elastic_t…
Browse files Browse the repository at this point in the history
…emplate_check

FIX: Check Elasticsearch for endpoint component template before loading templates
  • Loading branch information
weslambert committed Aug 22, 2024
2 parents dfb0ff7 + d7e3e13 commit 96339f0
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ if [ ! -f $STATE_FILE_SUCCESS ]; then
echo -n "Waiting for ElasticSearch..."
retry 240 1 "so-elasticsearch-query / -k --output /dev/null --silent --head --fail" || fail "Connection attempt timed out. Unable to connect to ElasticSearch. \nPlease try: \n -checking log(s) in /var/log/elasticsearch/\n -running 'sudo docker ps' \n -running 'sudo so-elastic-restart'"
{% if GLOBALS.role != 'so-heavynode' %}
SESSIONCOOKIE=$(curl -s -K /opt/so/conf/elasticsearch/curl.config -c - -X GET http://localhost:5601/ | grep sid | awk '{print $7}')
INSTALLED=$(elastic_fleet_package_is_installed endpoint }} )
if [ "$INSTALLED" != "installed" ]; then
TEMPLATE="logs-endpoint.alerts@package"
INSTALLED=$(so-elasticsearch-query _component_template/$TEMPLATE | jq -r .component_templates[0].name)
if [ "$INSTALLED" != "$TEMPLATE" ]; then
echo
echo "Packages not yet installed."
echo
Expand Down

0 comments on commit 96339f0

Please sign in to comment.