HP/UX changes after site testing
This commit is contained in:
@@ -80,10 +80,11 @@ exit_with_error() {
|
||||
|
||||
check_http_error() {
|
||||
# All good responses start with a 2
|
||||
if [ ${http_response:0:1} != "2" ]; then
|
||||
echo FATAL: HTTP error from API call: $http_response. The server responded with:
|
||||
cat /tmp/rbkresponse.$$ ; echo ; exit_with_error
|
||||
fi
|
||||
first_char=$(echo "$http_response" | cut -c1)
|
||||
if [ "$first_char" != "2" ]; then
|
||||
echo FATAL: HTTP error from API call: $http_response. The server responded with:
|
||||
cat /tmp/rbkresponse.$$ ; echo ; exit_with_error
|
||||
fi
|
||||
}
|
||||
|
||||
check_pid() {
|
||||
@@ -217,7 +218,7 @@ get_mv() {
|
||||
mvId=$(awk '{match($0, /ManagedVolume:::[a-z0-9-]*/); if (RSTART > 0) {id=substr($0, RSTART, RLENGTH); sub(/"$/, "", id); print id}}' /tmp/rbkresponse.$$)
|
||||
numChannels=$(awk '{match($0, /"numChannels":[ ]*[0-9]+/); if (RSTART > 0) {val=substr($0, RSTART, RLENGTH); sub(/.*:[ ]*/, "", val); print val}}' /tmp/rbkresponse.$$)
|
||||
|
||||
if [[ $mvId == "" ]]; then
|
||||
if [ -z "$mvId" ]; then
|
||||
echo ERROR: MV with name $mv_name was not found
|
||||
exit_with_error
|
||||
fi
|
||||
@@ -226,7 +227,7 @@ get_mv() {
|
||||
|
||||
get_data_mv() {
|
||||
|
||||
mv_name=${HOST}_${ORACLE_SID}_data
|
||||
mv_name=${HOST}_${ORACLE_SID}_Data
|
||||
|
||||
ENDPOINT="https://$RUBRIK_IP/api/internal/managed_volume?name=$mv_name&is_relic=false"
|
||||
rest_api_get
|
||||
@@ -234,7 +235,7 @@ get_data_mv() {
|
||||
mvId=$(awk '{match($0, /ManagedVolume:::[a-z0-9-]*/); if (RSTART > 0) {id=substr($0, RSTART, RLENGTH); sub(/"$/, "", id); print id}}' /tmp/rbkresponse.$$)
|
||||
numChannels=$(awk '{match($0, /"numChannels":[ ]*[0-9]+/); if (RSTART > 0) {val=substr($0, RSTART, RLENGTH); sub(/.*:[ ]*/, "", val); print val}}' /tmp/rbkresponse.$$)
|
||||
|
||||
if [[ $mvId == "" ]]; then
|
||||
if [ -z "$mvId" ]; then
|
||||
echo ERROR: MV with name $mv_name was not found
|
||||
exit_with_error
|
||||
fi
|
||||
@@ -245,16 +246,16 @@ get_log_mv() {
|
||||
|
||||
# Look for a log volume. If not present, return the data volume
|
||||
|
||||
mv_name=${HOST}_${ORACLE_SID}_logs
|
||||
mv_name=${HOST}_${ORACLE_SID}_Log
|
||||
ENDPOINT="https://$RUBRIK_IP/api/internal/managed_volume?name=$mv_name&is_relic=false"
|
||||
rest_api_get
|
||||
|
||||
logMvId=$(awk '{match($0, /ManagedVolume:::[a-z0-9-]*/); if (RSTART > 0) {id=substr($0, RSTART, RLENGTH); sub(/"$/, "", id); print id}}' /tmp/rbkresponse.$$)
|
||||
|
||||
if [[ $logMvId == "" ]]; then
|
||||
if [ -z "$logMvId" ]; then
|
||||
echo "INFO: Log volume ($mv_name) not found. Logs will be written to DB volume"
|
||||
logMvPresent=0
|
||||
mv_name=${HOST}_${ORACLE_SID}_data
|
||||
mv_name=${HOST}_${ORACLE_SID}_Data
|
||||
|
||||
ENDPOINT="https://$RUBRIK_IP/api/internal/managed_volume?name=$mv_name&is_relic=false"
|
||||
rest_api_get
|
||||
@@ -262,7 +263,7 @@ get_log_mv() {
|
||||
mvId=$(awk '{match($0, /ManagedVolume:::[a-z0-9-]*/); if (RSTART > 0) {id=substr($0, RSTART, RLENGTH); sub(/"$/, "", id); print id}}' /tmp/rbkresponse.$$)
|
||||
numChannels=$(awk '{match($0, /"numChannels":[ ]*[0-9]+/); if (RSTART > 0) {val=substr($0, RSTART, RLENGTH); sub(/.*:[ ]*/, "", val); print val}}' /tmp/rbkresponse.$$)
|
||||
|
||||
if [[ $mvId == "" ]]; then
|
||||
if [ -z "$mvId" ]; then
|
||||
echo ERROR: MV with name $mv_name was not found
|
||||
exit_with_error
|
||||
fi
|
||||
@@ -308,3 +309,4 @@ cleanup() {
|
||||
rm -f /tmp/rbkresponse.$$
|
||||
rm -f $PIDFILE
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user