mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
improve verbosity of setup logs
This commit is contained in:
@@ -774,6 +774,7 @@ if ! [[ -f $install_opt_file ]]; then
|
|||||||
title "Setting up Elastic Fleet"
|
title "Setting up Elastic Fleet"
|
||||||
logCmd "salt-call state.apply elasticfleet.config"
|
logCmd "salt-call state.apply elasticfleet.config"
|
||||||
if ! logCmd so-elastic-fleet-setup; then
|
if ! logCmd so-elastic-fleet-setup; then
|
||||||
|
error "Failed to run so-elastic-fleet-setup"
|
||||||
fail_setup
|
fail_setup
|
||||||
fi
|
fi
|
||||||
if [[ ! $is_import ]]; then
|
if [[ ! $is_import ]]; then
|
||||||
|
|||||||
@@ -61,8 +61,11 @@ log_has_errors() {
|
|||||||
grep -vE "Running scope as unit" &> "$error_log"
|
grep -vE "Running scope as unit" &> "$error_log"
|
||||||
|
|
||||||
if [[ $? -eq 0 ]]; then
|
if [[ $? -eq 0 ]]; then
|
||||||
|
# This function succeeds (returns 0) if errors are detected
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# No errors found, return 1 (function failed to find errors)
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -121,7 +124,10 @@ main() {
|
|||||||
echo "WARNING: Failed setup a while ago"
|
echo "WARNING: Failed setup a while ago"
|
||||||
exit_code=1
|
exit_code=1
|
||||||
elif log_has_errors; then
|
elif log_has_errors; then
|
||||||
echo "WARNING: Errors detected during setup"
|
echo "WARNING: Errors detected during setup."
|
||||||
|
echo "--------- ERRORS ---------"
|
||||||
|
cat $error_log
|
||||||
|
echo "--------------------------"
|
||||||
exit_code=1
|
exit_code=1
|
||||||
touch /root/failure
|
touch /root/failure
|
||||||
elif using_iso && cron_error_in_mail_spool; then
|
elif using_iso && cron_error_in_mail_spool; then
|
||||||
|
|||||||
Reference in New Issue
Block a user