opendistro-for-elasticsearch / alerting

📟 Open Distro Alerting Plugin
https://opendistro.github.io/for-elasticsearch/features/alerting.html
Apache License 2.0
279 stars 80 forks source link

Alerting with email as a destination not working in version 13.1.0.1. #382

Closed Kanmanir closed 2 years ago

Kanmanir commented 3 years ago

Alerting with email as a destination not working in version 13.1.0.1.

I have added email as a destination , I followed procedure given on official page

  1. Created a sender with smtp as outlook 365 with TLS port 587 and recipient email group for the destination.
  2. Tried to add the credentials using the below command, ./bin/elasticsearch-keystore add opendistro.alerting.destination.email.xxxx.username ./bin/elasticsearch-keystore add opendistro.alerting.destination.email.xxxx.password

when tried to see what is the code used in elasticsearch-keystore, I found out it uses a class KeyStoreCli.

But KeyStoreCli class "org.elasticsearch.common.settings.KeyStoreCli" is not available in 7.10.2 in javadocs instead it has class BaseKeyStoreCommand

https://www.javadoc.io/doc/org.elasticsearch/elasticsearch/7.10.2/org/elasticsearch/common/settings/BaseKeyStoreCommand.html

keyStoreCli class is available upto 7.7.1 in javadocs https://www.javadoc.io/doc/org.elasticsearch/elasticsearch/7.7.1/org/elasticsearch/common/settings/KeyStoreCli.html

But in opendistro version 1.13.0.1 has jar available for KeyStoreCli /usr/share/elasticsearch/lib/tools/keystore-cli and this jar containes the KeyStoreCli.class

[root@3995dd7839e7 keystore-cli]# jar xvf keystore-cli-7.10.2.jar
created: META-INF/
inflated: META-INF/MANIFEST.MF
inflated: META-INF/LICENSE.txt
inflated: META-INF/NOTICE.txt
created: org/
created: org/elasticsearch/
created: org/elasticsearch/common/
created: org/elasticsearch/common/settings/
inflated: org/elasticsearch/common/settings/ AddFileKeyStoreCommand.class
inflated: org/elasticsearch/common/settings/KeyStoreCli.class
inflated: org/elasticsearch/common/settings/CreateKeyStoreCommand.class
inflated: org/elasticsearch/common/settings/ListKeyStoreCommand.class
inflated: org/elasticsearch/common/settings/RemoveSettingKeyStoreCommand.class
inflated: org/elasticsearch/common/settings/AddStringKeyStoreCommand.class

it is using this lib and class why email destination not working, and I am not able to get where it is storing credentials of sender configured from destination.

Can anybody help with configuring email destination and make it work for alerting.

qreshi commented 2 years ago

Closing in favor of https://github.com/opensearch-project/alerting/issues/101