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