mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 09:12:45 +01:00
Move API check logic
This commit is contained in:
20
salt/kibana/tools/sbin/so-kibana-api-check
Normal file
20
salt/kibana/tools/sbin/so-kibana-api-check
Normal file
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
||||
# Elastic License 2.0.
|
||||
|
||||
. /usr/sbin/so-common
|
||||
|
||||
echo "Checking to make sure that Kibana API is up & ready..."
|
||||
RETURN_CODE=0
|
||||
wait_for_web_response "http://localhost:5601/api/fleet/settings" "fleet" 300 "curl -K /opt/so/conf/elasticsearch/curl.config"
|
||||
RETURN_CODE=$?
|
||||
if [[ "$RETURN_CODE" != "0" ]]; then
|
||||
echo "Kibana API not accessible, exiting script..."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
|
||||
@@ -534,15 +534,6 @@ up_to_2.4.30() {
|
||||
rm -f /opt/so/conf/elastic-fleet/integrations/endpoints-initial/elastic-defend-endpoints.json
|
||||
. /usr/sbin/so-elastic-fleet-common
|
||||
|
||||
echo "Checking to make sure that Kibana API is up & ready..."
|
||||
RETURN_CODE=0
|
||||
wait_for_web_response "http://localhost:5601/api/fleet/settings" "fleet" 300 "curl -K /opt/so/conf/elasticsearch/curl.config"
|
||||
RETURN_CODE=$?
|
||||
if [[ "$RETURN_CODE" != "0" ]]; then
|
||||
echo "Kibana API not accessible, exiting script..."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
elastic_fleet_integration_remove endpoints-initial elastic-defend-endpoints
|
||||
/usr/sbin/so-elastic-fleet-integration-policy-elastic-defend
|
||||
|
||||
@@ -756,17 +747,9 @@ apply_hotfix() {
|
||||
elif [[ "$INSTALLEDVERSION" == "2.4.30" ]] ; then
|
||||
rm -f /opt/so/conf/elastic-fleet/integrations/endpoints-initial/elastic-defend-endpoints.json
|
||||
so-kibana-restart --force
|
||||
so-kibana-api-check
|
||||
. /usr/sbin/so-elastic-fleet-common
|
||||
|
||||
echo "Checking to make sure that Kibana API is up & ready..."
|
||||
RETURN_CODE=0
|
||||
wait_for_web_response "http://localhost:5601/api/fleet/settings" "fleet" 300 "curl -K /opt/so/conf/elasticsearch/curl.config"
|
||||
RETURN_CODE=$?
|
||||
if [[ "$RETURN_CODE" != "0" ]]; then
|
||||
echo "Kibana API not accessible, exiting script..."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
elastic_fleet_integration_remove endpoints-initial elastic-defend-endpoints
|
||||
/usr/sbin/so-elastic-fleet-integration-policy-elastic-defend
|
||||
salt-call state.highstate
|
||||
|
||||
Reference in New Issue
Block a user