cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Alert for switching from one DB server to another

Ahmed.Zarad
Producer

Dears,

We have 2 DB servers, one is primary & the other is secondary and we are monitoring them using DNS, which take us to the working one. But when a switch occurs from the primary server to the secondary one, no indication shows this switch while the data is shown fine 

 

So we are searching for any metric or alert that can notify us when the switching process occurs.

1 REPLY 1

Hiroki.Ito
AppDynamics Team

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.

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

Found something helpful? Click the Accept as Solution button to help others find answers faster.
Liked something? Click the Thumbs Up button.