FAILOVER Failover service

Example 1. Using the START and STOP events for the Failover service

Objects from more than one main Server must not be moved to the Backup Server. For this, when moving objects from some main Server to the Backup Server, all otherĀ Failover service objects must be disabled on this Backup Server.

if (Event.SourceType  == "FAILOVER" )
{
  if (Event.Action == "START") {action="DISABLE";}
  if (Event.Action == "STOP") {action="ENABLE";}
  id=Event.SourceId;
  msg=CreateMsg();
  msg.StringToMsg(GetObjectIds("FAILOVER"));
  var
  objCount=msg.GetParam("id.count");
    for (i=0;i<objCount;i++)
    {
     pid=msg.GetParam("id."+i);
  
     if (!(id==pid)) {
       DoReactStr("FAILOVER",pid,action,"");
     }
  } 
}