4 # Copyright © 2018 Amdocs
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
20 if [ "$enableDebugLogging" = true ]; then
24 echo $( date ) $@ >> $LOGFILE
29 LOGFILE="/app/geo.log"
30 enableDebugLogging=true
33 debugLog "Executing ensureSdncStandby"
35 # query SDN-C cluster status
36 debugLog "Started executing sdnc.cluster"
37 clusterStatus=$( /app/bin/sdnc.cluster )
38 debugLog "Completed executing sdnc.cluster. Cluster status is: $clusterStatus"
40 if [ "active" = "$clusterStatus" ]; then
41 # assume transient error as other side transitions to ACTIVE
42 debugLog "Cluster status: $clusterStatus. exit 0"
45 elif [ "standby" = "$clusterStatus" ]; then
46 # check that standby cluster is healthy
47 debugLog "Started executing sdnc.monitor. Cluster status is: $clusterStatus"
48 health=$( /app/bin/sdnc.monitor )
49 debugLog "Completed executing sdnc.monitor. Cluster is: $health"
50 if [ "failure" = "$health" ];then
51 # Backup site is unhealthy - can't accept traffic!
54 # Cluster is standing by
58 debugLog "Unknown cluster status: $clusterStatus"
59 # Unknown cluster status