Master-backup status

Hi, does anyone know if there's a script available to check the master-backup redundancy status?

There are system tags available, [System]Gateway/Redundancy/IsMaster should give you the status you're looking for.

Thanks for the reply. Found it. Thanks again

Be aware that scripts do not run on the inactive gateway in a redundant pair.

Sorry to revive this old thread, but I was naively assuming we could use isMaster value change to trigger some event (I am resynching some results that write to a datacenter replicated Postgres server in the event our on prem servers go down). The tag simply goes to an errored state and never runs.

What is the right way to trigger application-level, rather than DB level synchs like this? Using isMaster seemed the most straightforward way to do this, but it is not working the way I thought. I am confused why the tag value would not persist or be syched when switching between master and backup and vice versa.

Events are scripts. See my comment just above yours.

Bad use of the word "event", sorry. I am just trying to fire a tag change script on isMaster. I have no problem running other tag change scripts when it fails over to backup. This one is a ref tag looking at isMaster system tag. It synchs data from an off prem postgres instance with a on prem postgres instance when isMaster transitions from 0 to 1. I have no issues with other tag change scripts, but this one is seemingly not firing. It may just be a misunderstanding of how isMaster works in general, or how it works specifically when using the web server button "Force Failover".

Perhaps because there is no change? isMaster will always be true on the master gateway, and always false on the backup gateway, so they never change. You should be monitoring isActive and within that, read and check isMaster. (But note that I wouldn't expect to see isActive go false, as the script should be disabled by the role.)