K
K
Konstantin2020-02-22 19:09:46
linux
Konstantin, 2020-02-22 19:09:46

Can Heartbeat do two checks to decide if a node is unreachable?

Hello.
I was planning to write a bash script to monitor server availability and found out that Heartbeat already exists for this.
But I want to do a more complex check to make a decision about the unavailability of the desired server.
Example:
srv1 - server located in DPC-1
srv2 - server located in DPC-2
I want my script to run on srv2 if server srv1 is unavailable.

Options when srv2 will consider srv1 unavailable:
1) srv1 is disconnected from the Internet (srv2 sees the Internet / google.com)
2) srv2 is disconnected from the Internet (srv2 does NOT see the Internet / google.com)

It turns out that you need to additionally check some a node on the Internet in order to understand exactly in which case now srv2.

Can Heartbeat do this? I just haven't delved into it at all so as not to waste time.
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Valentine, 2020-02-27
@ProFfeSsoRr

If this is done for monitoring - there are already a bunch of tools, choose the one that can do what you need. Prometheus and Zabbix are popular now.
If the check is needed to balance traffic (the machine has disappeared - we stop sending traffic there), use smart envoy or haproxy.
There is still such a moment: let's say from the side of server A (on which monitoring is installed), the srv2 server is no longer available. So you don't need to send clients to it, etc. But, if something is available on the srv2 server itself, then it can take some action itself - this is another tool. Those. for example, you monitor from server A - srv2 is unavailable, go to the balancer and disable traffic to srv2 there. srv2 itself runs some kind of script that checks the availability of the Internet. There is no Internet - for example, a link on the network interface pulls, or maybe there is a device for sending SMS - well, then it sends SMS, etc. Those. These are 2 independent tasks, solved from different sides.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question