I try to use the following code to display gateway redundancy activity level of both gateway on a client :
Inside a 1 sec timer gateway script :
import system
from com.inductiveautomation.ignition.gateway import SRContext
if SRContext.get().getRedundancyManager().isMaster():
pathCurrentGW = "DIAG/serverM/system/ActivityLevel"
pathPeerGW = "DIAG/serverB/system/ActivityLevel"
else:
pathCurrentGW = "DIAG/serverB/system/ActivityLevel"
pathPeerGW = "DIAG/serverM/system/ActivityLevel"
# Return : Active / Cold / Hot / Undecided / Warm
etat = str(SRContext.get().getRedundancyManager().getCurrentState().getActivityLevel())
system.tag.write(pathCurrentGW,etat)
etat = str(SRContext.get().getRedundancyManager().getPeerConnectionStatus().getActivityLevel())
system.tag.write(pathPeerGW,etat)
It doesn’t work in all case…
It’s ok when Master is active and backup is warm,
but when I force a failover to the backup :
tag : DIAG/serverM/system/ActivityLevel display active instead of warm as in the web page !
When I restart the Master, with backup actibe, the tag DIAG/serverM/system/ActivityLevel display : undecided instead of active as in the web page ?
Any idea to correct this or another way to achieve this : displaying both gateway redundancy activity level in the client.