@@ -427,7 +427,7 @@ function splunkconf_checkspace {
427427METADATA_URL=" http://metadata.google.internal/computeMetadata/v1"
428428function check_cloud() {
429429 cloud_type=0
430- response=$( curl -fs -m 5 -H " Metadata-Flavor: Google" ${METADATA_URL} )
430+ response=$( curl -fs -m 5 --connect-timeout $CURLCONNECTTIMEOUT --max-time $CURLMAXTIME - H " Metadata-Flavor: Google" ${METADATA_URL} )
431431 if [ $? -eq 0 ]; then
432432 debug_log ' GCP instance detected'
433433 cloud_type=2
@@ -1582,10 +1582,10 @@ if [ "$MODE" == "0" ] || [ "$MODE" == "kvdump" ] || [ "$MODE" == "kvstore" ] ||
15821582 MGMTURL=` ${SPLUNK_HOME} /bin/splunk btool web list settings --debug | grep mgmtHostPort | grep -v \# | sed -r ' s/.*=\s*([0-9\.:]+)/\1/' | tail -1`
15831583
15841584 # check pre backup
1585- RES=` curl --silent -k https://${MGMTURL} /services/kvstore/status --header " Authorization: Splunk ${sessionkey} " `
1585+ RES=` curl --silent -k --connect-timeout $CURLCONNECTTIMEOUT --max-time $CURLMAXTIME https://${MGMTURL} /services/kvstore/status --header " Authorization: Splunk ${sessionkey} " `
15861586 debug_log " PREKVDUMP backup full kvstore status RES=$RES "
1587- RES=` curl --silent -k https://${MGMTURL} /services/kvstore/status --header " Authorization: Splunk ${sessionkey} " | grep backupRestoreStatus | grep -i Ready`
1588- RESREADY=` curl --silent -k https://${MGMTURL} /services/kvstore/status --header " Authorization: Splunk ${sessionkey} " | grep ' name="status"' | grep -i ready`
1587+ RES=` curl --silent -k --connect-timeout $CURLCONNECTTIMEOUT --max-time $CURLMAXTIME https://${MGMTURL} /services/kvstore/status --header " Authorization: Splunk ${sessionkey} " | grep backupRestoreStatus | grep -i Ready`
1588+ RESREADY=` curl --silent -k --connect-timeout $CURLCONNECTTIMEOUT --max-time $CURLMAXTIME https://${MGMTURL} /services/kvstore/status --header " Authorization: Splunk ${sessionkey} " | grep ' name="status"' | grep -i ready`
15891589 debug_log " PREKVDUMP kvstore status before launching backup RES=$RESi RESREADY=$RESREADY "
15901590 # debug_log "COUNTER=$COUNTER $MESSVER $MESS1 type=$TYPE object=${kvbackupmode} action=backup result=running "
15911591
@@ -1604,8 +1604,8 @@ if [ "$MODE" == "0" ] || [ "$MODE" == "kvdump" ] || [ "$MODE" == "kvstore" ] ||
16041604 # increase here if needed (ie take more time !)
16051605 # until either we do max try or combined result from kvstorebackup ready and status ready are ok
16061606 until [[ $COUNTER -lt 1 || -n " $RES2 " ]]; do
1607- RES=` curl --silent -k https://${MGMTURL} /services/kvstore/status --header " Authorization: Splunk ${sessionkey} " | grep backupRestoreStatus | grep -i Ready`
1608- RESREADY=` curl --silent -k https://${MGMTURL} /services/kvstore/status --header " Authorization: Splunk ${sessionkey} " | grep ' name="status"' | grep -i ready`
1607+ RES=` curl --silent -k --connect-timeout $CURLCONNECTTIMEOUT --max-time $CURLMAXTIME https://${MGMTURL} /services/kvstore/status --header " Authorization: Splunk ${sessionkey} " | grep backupRestoreStatus | grep -i Ready`
1608+ RESREADY=` curl --silent -k --connect-timeout $CURLCONNECTTIMEOUT --max-time $CURLMAXTIME https://${MGMTURL} /services/kvstore/status --header " Authorization: Splunk ${sessionkey} " | grep ' name="status"' | grep -i ready`
16091609 if [[ -n " $RES " && -n " $RESREADY " ]]; then
16101610 RES2=$RES
16111611 else
@@ -1631,7 +1631,7 @@ if [ "$MODE" == "0" ] || [ "$MODE" == "kvdump" ] || [ "$MODE" == "kvstore" ] ||
16311631 # auto ie 0 or without value 1
16321632 debug_log " launching kvdump backup via REST API with archiveName=${KVARCHIVE} and pointInTime disabled"
16331633 fi
1634- RES=` curl --silent -k https://${MGMTURL} /services/kvstore/backup/create -X post --header " Authorization: Splunk ${sessionkey} " -d" archiveName=${KVARCHIVE} " $OPTIONPOINTINTIME `
1634+ RES=` curl --silent -k --connect-timeout $CURLCONNECTTIMEOUT --max-time $CURLMAXTIME https://${MGMTURL} /services/kvstore/backup/create -X post --header " Authorization: Splunk ${sessionkey} " -d" archiveName=${KVARCHIVE} " $OPTIONPOINTINTIME `
16351635
16361636 # echo_log "KVDUMP CREATE RES=$RES"
16371637 COUNTER=${KVSTOREREADYBACKUP}
@@ -1640,7 +1640,7 @@ if [ "$MODE" == "0" ] || [ "$MODE" == "kvdump" ] || [ "$MODE" == "kvstore" ] ||
16401640 # wait a bit (up to 20*10= 200s) for backup to complete, especially for big kvstore/busy env (io)
16411641 # increase here if needed (ie take more time !)
16421642 until [[ $COUNTER -lt 1 || -n " $RES " ]]; do
1643- RES=` curl --silent -k https://${MGMTURL} /services/kvstore/status --header " Authorization: Splunk ${sessionkey} " | grep backupRestoreStatus | grep -i Ready`
1643+ RES=` curl --silent -k --connect-timeout $CURLCONNECTTIMEOUT --max-time $CURLMAXTIME https://${MGMTURL} /services/kvstore/status --header " Authorization: Splunk ${sessionkey} " | grep backupRestoreStatus | grep -i Ready`
16441644 # echo_log "RES=$RES"
16451645 debug_log " COUNTER=$COUNTER (max=${COUNTERMAX} ) $MESSVER $MESS1 type=$TYPE object=${kvbackupmode} action=backup result=running info=postbackup"
16461646 let COUNTER-=1
0 commit comments