Hi @Ahmed.Zarad ,
Thank you for posting to the community.
If there is a query that can return information related to the switch, you can use custom metrics to detect the switch.
Please see the document below for details.
https://docs.appdynamics.com/21.6/en/database-visibility/monitor-databases-and-database-servers/configure-custom-metrics
For instance, a query like the following in mysql returns 1 if db collector is targeting the specified hostname and 0 after the switch because the hostname changes.
select count(*) from (select @@hostname as host) as hostname where host = <Hostname> ;
By monitoring the custom metric with a health rule, you should be able to configure a policy to send a notification when the switch occurs.
Best Regards,
Hiroki
... View more