Wanted to monitor elasticsearch and opensearch through check_mk

You can try to run the special agent on the command line to see where its failing.

It could be https: Elasticsearch cluster moniting while using TLS / HTTPS.