In Consul you can have many agents as servers or clients. Amongst all servers one is chosen as the leader. From the agent\'s point of view, how does it know it is the leader?
One way is by calling the cluster with http://:8500/v1/status/leader
http://:8500/v1/status/leader
This will return the current leader. Then just check the IP address returned against the local IP address.