Redundant State Subcription

How can I subscribe the gateway Redundant State? I am developing new OPC Drivers Modules and I need to know what is teh state of the system it is running on.


You can get the platform RedundancyManager via the GatewayContext, which should be accessible from the DriverContext your driver has:

RedundancyManager redundancyManager = driverContext.getGatewayContext().getRedundancyManager();

From there, you can add a RedundancyStateListener:

redundancyManager.addRedundancyStateListener(new RedundancyStateListener() {
	public void redundancyStateChanged(RedundancyState newState) {
		// TODO

	public void redundancyConnStatusChanged(ClusterPeerConnectionStatus status) {
		// TODO

You’ll likely be interested in the ActivityLevel that you can from the RedundancyState object.

We have realized we would like to monitor the redundancy state via a timer script and gateway tags. Is there a way to add this state listener right from a startup script?

I would rather not have to make a module just to monitor this status unless I absolutely have to.


Just for posterity:

The following code on a gateway timer script will get the sync status of the redundant pair:
Ennumerated values are defined here:

from com.inductiveautomation.ignition.gateway import SRContext
contextRM = SRContext.get().getRedundancyManager()
state = contextRM.getPeerConnectionStatus().getProjectState().toString()