# Elasticsearch Cluster Health watch Watcher

**URL:** <https://discuss.elastic.co/t/elasticsearch-cluster-health-watch-watcher/338321>\
**Category:** Elasticsearch\
**Created:** [July 13, 2023, 11:29am UTC](https://discuss.elastic.co/t/elasticsearch-cluster-health-watch-watcher/338321 "2023-07-13T11:29:01Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shalinicts](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shalinicts/32/81251_2.png) [@Shalinicts](https://discuss.elastic.co/u/Shalinicts)\
**Post date:** [July 13, 2023, 11:29am UTC](https://discuss.elastic.co/t/elasticsearch-cluster-health-watch-watcher/338321/1 "2023-07-13T11:29:01Z")

</div>

Hi Team,

I am trying to create a watcher for cluster health check (Clluster is 3 master and 5 data node ) as per Elastic documentation

> **[Watching the status of an Elasticsearch cluster | Elasticsearch Guide \[8.8\] |...](https://www.elastic.co/guide/en/elasticsearch/reference/current/watch-cluster-status.html)**

In the input section it is referred to provide host as **host:localhost**

"input" : {  
"http" : {  
"request" : {  
"host" : "localhost",  
"port" : 9200,  
"path" : "/\_cluster/health"  
}

What can we give if we are using a loadbalancing URL (ex: [myelasticportal.company.com](http://myelasticportal.company.com)) as my elastic URL .

We tried giving URL as host, server ip of datanode as host which didnot worked.  
Any suggestions please.

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [July 13, 2023, 12:16pm UTC](https://discuss.elastic.co/t/elasticsearch-cluster-health-watch-watcher/338321/2 "2023-07-13T12:16:47Z")

</div>

> [@Shalinicts](#):
>
> We tried giving URL as host, server ip of datanode as host which didnot worked.

What is the error? If the watcher does not work it will generate an error that you can check in the Logs or in Kibana.

---

<div class="post-metadata">

**Author:** ![Shalinicts](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shalinicts/32/81251_2.png) [@Shalinicts](https://discuss.elastic.co/u/Shalinicts)\
**Post date:** [July 13, 2023, 12:19pm UTC](https://discuss.elastic.co/t/elasticsearch-cluster-health-watch-watcher/338321/3 "2023-07-13T12:19:29Z")

</div>

Yes There is error below -  
type": "unknown\_host\_exception",  
"reason": "https: Temporary failure in name resolution"

This is the error when we give individual servername/server ip/ cluster URL

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [July 13, 2023, 12:31pm UTC](https://discuss.elastic.co/t/elasticsearch-cluster-health-watch-watcher/338321/4 "2023-07-13T12:31:09Z")

</div>

> [@Shalinicts](#):
>
> This is the error when we give individual servername/server ip/ cluster URL

You got the same error when using these 3 different settings?

Setting an IP address would not generate a resolution failure I think.

Using `localhost` should also not give a resolution name error. Can you share how your `elasticsearch.yml` looks like?

What is the return of `curl http://localhost:9200/_cluster/health` from one of your nodes?

---

<div class="post-metadata">

**Author:** ![Shalinicts](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shalinicts/32/81251_2.png) [@Shalinicts](https://discuss.elastic.co/u/Shalinicts)\
**Post date:** [July 13, 2023, 12:51pm UTC](https://discuss.elastic.co/t/elasticsearch-cluster-health-watch-watcher/338321/5 "2023-07-13T12:51:00Z")

</div>

`curl http://localhost:9200/_cluster/health` - This is the error  
Failed to connect to localhost port 9200: Connection refused

`curl http://my actual host name :9200/_cluster/health`  
Could not resolve host: myactualhostname

`curl http://serverip :9200/_cluster/health`  
(When I gave server IP)  
Got below error  
Empty reply from server

---

<div class="post-metadata">

**Author:** ![Shalinicts](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shalinicts/32/81251_2.png) [@Shalinicts](https://discuss.elastic.co/u/Shalinicts)\
**Post date:** [July 13, 2023, 12:54pm UTC](https://discuss.elastic.co/t/elasticsearch-cluster-health-watch-watcher/338321/6 "2023-07-13T12:54:51Z")

</div>

I am getting response for curl when I tried

curl -u username:password [https://mynetworkhostname](https://mynetworkhostname) :9200/\_cluster/health

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [July 13, 2023, 12:56pm UTC](https://discuss.elastic.co/t/elasticsearch-cluster-health-watch-watcher/338321/7 "2023-07-13T12:56:45Z")

</div>

> [@Shalinicts](#):
>
> curl -u username:password [https://mynetworkhostname](https://mynetworkhostname) :9200/\_cluster/health

You are using `https` then, you need to configure it in the input according to the [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/input-http.html#http-input-attributes).

You need to set `request.scheme` to `https`, if you do not set it, `http` will be used.

---

<div class="post-metadata">

**Author:** ![Shalinicts](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shalinicts/32/81251_2.png) [@Shalinicts](https://discuss.elastic.co/u/Shalinicts)\
**Post date:** [July 13, 2023, 1:14pm UTC](https://discuss.elastic.co/t/elasticsearch-cluster-health-watch-watcher/338321/8 "2023-07-13T13:14:02Z")

</div>

When I give https as scheme and host: "mynetworkhostname"

Am getting beow error

"root\_cause": [  
{  
"type": "s\_s\_l\_handshake\_exception",  
"reason": "PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target"  
}  
],

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [July 13, 2023, 1:36pm UTC](https://discuss.elastic.co/t/elasticsearch-cluster-health-watch-watcher/338321/9 "2023-07-13T13:36:55Z")

</div>

> [@Shalinicts](#):
>
> "type": "s\_s\_l\_handshake\_exception",  
> "reason": "PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target"

Yeah, you will need to configure the watcher settings according to the [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/notification-settings.html#ssl-notification-settings).

Basically you will need to pass the path where the certificate CA is.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 10, 2023, 1:37pm UTC](https://discuss.elastic.co/t/elasticsearch-cluster-health-watch-watcher/338321/10 "2023-08-10T13:37:37Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
