Heartbeat for failover CCS
In order to monitor primary site state, setup a heartbeat of the Brekeke PBX on secondary site.
Example :

In this example, if primary server becomes failed, the status of secondary system will be changed from “Standby”to “Active” by the scrip set as the [Action 1], then as the [Action 2],the shell script “switch_dns_record.sh” that updates a DNS record will be executed.
[Action 1]
For detail, refer to the Sample Script for Heartbeat action: Switching Brekeke CCS Status>>
[Action 2]
<switch_dns_record.sh>
#!/bin/bash self_dir=$(cd $(dirname $0); pwd) aws route53 change-resource-record-sets --hosted-zone-id Z0XXXXXXXXXXXXX --change-batch file://$self_dir/switch_dns.json
* In this example, aws cli(https://aws.amazon.com/cli/) command is used for switching DNS record. AWS CLI can update DNS records of the Route53 which is DNS service provided by AWS.
* Change the value of the hosted-zone-id to the applopriate one.
<switch_dns.json>
{
"Comment": "updated by the switchover script",
"Changes": [
{
"Action": "UPSERT",
"ResourceRecordSet": {
"Name": "sub.yourdomain.com",
"Type": "A",
"TTL": 300,
"ResourceRecords": [
{
"Value": "xxx.xxx.xxx.xxx"
}
]
}
}
]
}
*Change the value of “Value” and “Name”.
