I’m developing a plugin that also needs to catch Failover Events.
When the plugin starts it reads, using the Config API, the structure of the Recording Servers (devices, failover, storage, etc.), Failover Groups and Failover RS.
When the RS goes OffLine and the FRS OnLine the WEB URI of the RS becomes that of the FRS and this allows me to understand that it is a Failover Event, when the opposite happens the RS assumes the original WEB URI, indicating that it is a Recovery Event.
If when the plugin starts with RS already in Failover mode, naturally the WEB URI is that of the FRS, and this allows me to understand that we are in Failover Mode, but it seems that there is no way to know the original WEB URI of the RS, preventing me from understanding when a Restore Event occurs.
The questions are:
1 - Is there a way to know the original WEB URI?
2 - Is there a different method to catch and manage RS Failovers for a plugin?
Many Thanks,
Frediano
No. I had the idea that using the Configuration API you could read the setup, but it actually returns the active recording server, so in a failover situation you get the uri of the failover, and in this situation you cannot read the original uri.
The recommendation is to subscribe using
EnvironmentManager.Instance.RegisterReceiver(GetFOChangeHandler, new MessageIdFilter(MessageId.Server.RecorderFQIDChangedIndication));
This will signal you in the event the uri changes, both going into and out of failover. (But actually you cannot tell if you are going into failover or out of failover.)
PS. Your question has triggered a discussion here at Milestone if we should enhance the API so that you could tell if you are in failover or not..
I can confirm that on my system the Receiver is never activated. The system is 2023R3 updated to the latest hot-fixes.
I invite you to note what the documentation says … I am not in those conditions.
Many Thanks,
Frediano
You are right, I will work with this to see if I can find a way you get these messages in the correct way. Sorry about the wrong answer I realize I tested not in a plugin..
Bo,
Since it is possible to create Rules to Start and Stop Failover, isn’t there a way to intercept such Events without having to trigger a User Defined Event?
Thanks,
Frediano
Just for our understanding. Is there a particular reason you need the RS FQID (RS url or?)
Is it to be able to give a status whether failover is happening or do you need to communicate with the RS?
PS. Sorry, I think I lost track of this thread. Your new post reminded me.
I am developing a plugin for maintenance use of a system with over 2500 cameras, over 250 RS and several FRS and the Customer, when a Failover occurs, wants to know which FRS has been activated and where the recordings are.
Frediano