I am running an etcd cluster in my machine. I have added three members too. Is it possible to generate the an alarm/notification based on the condition that cluster is healthy/not-healthy and is it possible to read some email-ids from a YAML file and send a mail to these ids. I am able to do it in GO but not in Python. I just want directions to some websites or maybe some code from where I can infer and start.
The curl request is:
curl -L http://127.0.0.1:2379/health
And the output is:
{"health":"true"}
However there is another way through command-line:
./etcdctl cluster-health
And the output is:
member 8e9e05c52164694d is healthy: got healthy result from http://localhost:2379
cluster is healthy
I want the second result, parse it and then put my conditions like wait and retry.
Check out this video https://www.youtube.com/watch?v=rxfGXXEaDA0 on youtube where it is shown that you can send notification to slack using python. You can run the following code to execute any external command in python.
import os
os.system("./etcdctl cluster-health")