Watcher for nodes in elasticsearch

Hello guys

This I my first time working with watchers.
Can anyone help me with building watcher for all Elasticsearch nodes are running or stopped that is we should get alert when the node is stopped or started.
I need a watcher template for this issue.
Thank you

Is there a reason why you're not trying to do that with Kibana alerting where this is built in?

Cluster alerting includes:

Elasticsearch nodes changed. You have Elasticsearch nodes that were recently added or removed.

2 Likes

I need both methods.
Can you help me by providing watcher template or videos or good documentation that's easy to understand.

Something like Watcher HTTP input | Elasticsearch Guide [7.17] | Elastic would be a good starting point. Not sure I have seen a complete example for this scenario before. But start working with that and see how far you get.

1 Like

Yeah, Thank you I am working on this.

PUT _watcher/watch/testing-watch
{
"trigger": {
"schedule": {
"interval": "10s"
}
},
"input": {
"http": {
"request": {
"scheme": "https",
"host": "seaselk-dev-elastic.corp.chartercom.com",
"port": 443,
"method": "get",
"params": {},
"headers": {},
"auth": {
"basic": {
"username": "elastic",
"password": "*"
}
}
}
}
},
"condition": {
"always" : {}
},
"actions": {
"send_writerequests_email": {
"email": {
"profile": "standard",
"to": [
"
"
],
"subject": "Nodes status"
}
}
}
}
This is getting an error

"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",
"caused_by" : {
"type" : "validator_exception",
"reason" : "PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target",
"caused_by" : {
"type" : "sun_cert_path_builder_exception",
"reason" : "unable to find valid certification path to requested target"
}

Is their anyway without editing Elasticsearch.yml, we can skip the SSL handshake in watcher.

I'd try Watcher settings in Elasticsearch | Elasticsearch Guide [7.17] | Elastic — there is a none setting for TLS checking.

1 Like

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