Alerts are getting triggered but not sending email notification

I am on 2.1.0 and trying to setup alert monitors.
Have setup keystore and able to send test message.
Have created query level monitors and trigger is also activated but getting the following error:

Error: Failed running action: org.opensearch.OpenSearchStatusException: {"event_status_list": [{"config_id":"NPTMzYEBHWrnvG76RIej","config_type":"email","config_name":"Example-Mail ","email_recipient_status":[{"recipient":"examplerecipent@email.com","delivery_status":{"status_code":"424","status_text":"sendEmail Error, status:Can't send command to SMTP host"}}],"delivery_status":{"status_code":"424","status_text":"sendEmail Error, status:Can't send command to SMTP host"}}]}

can not figure out what is causing this,as new to opensearch.

I think I’m going to have to ask around for you on this one. There has to be some way to get more debugging information out of this situation.

Thanks for bringing your issue here @harshitS!

Hi @harshitS, just to confirm, you are able to send out team emails from the Notification plugin, but when using that notification channel as an action on an Alerting monitor, you would get the above error?

Also does this cluster have security enabled?

Yes, security is enabled in the cluster.
I set-up an email channel and a slack channel(this is working fine) .
But email channel is throwing that send mail error mentioned above.
I have configured keystore sender and test messages (email-channel) are working
but not getting email when the alert is getting triggered.

here is monitor status

{
  "took" : 3,
  "timed_out" : false,
  "_shards" : {
    "total" : 1,
    "successful" : 1,
    "skipped" : 0,
    "failed" : 0
  },
  "hits" : {
    "total" : {
      "value" : 1,
      "relation" : "eq"
    },
    "max_score" : 0.6931471,
    "hits" : [
      {
        "_index" : ".opendistro-alerting-config",
        "_id" : "_XTZGoIBQXHTt9Y1wngu",
        "_version" : 5,
        "_seq_no" : 109,
        "_primary_term" : 7,
        "_score" : 0.6931471,
        "_source" : {
          "type" : "monitor",
          "schema_version" : 5,
          "name" : "mark4",
          "monitor_type" : "query_level_monitor",
          "enabled" : true,
          "enabled_time" : 1658307854884,
          "schedule" : {
            "period" : {
              "interval" : 1,
              "unit" : "MINUTES"
            }
          },
          "inputs" : [
            {
              "search" : {
                "indices" : [
                  "<index-name-here-*>"
                ],
                "query" : {
                  "size" : 0,
                  "query" : {
                    "bool" : {
                      "filter" : [
                        {
                          "range" : {
                            "@timestamp" : {
                              "from" : "{{period_end}}||-1m",
                              "to" : "{{period_end}}",
                              "include_lower" : true,
                              "include_upper" : true,
                              "format" : "epoch_millis",
                              "boost" : 1.0
                            }
                          }
                        },
                        {
                          "term" : {
                            "alert.severity" : {
                              "value" : 1,
                              "boost" : 1.0
                            }
                          }
                        }
                      ],
                      "adjust_pure_negative" : true,
                      "boost" : 1.0
                    }
                  },
                  "aggregations" : {
                    "metric" : {
                      "value_count" : {
                        "field" : "alert.severity"
                      }
                    }
                  }
                }
              }
            }
          ],
          "triggers" : [
            {
              "query_level_trigger" : {
                "id" : "aHQmG4IBQXHTt9Y1G3lK",
                "name" : "t5",
                "severity" : "1",
                "condition" : {
                  "script" : {
                    "source" : "return ctx.results[0].aggregations.metric.value == null ? false : ctx.results[0].aggregations.metric.value > 2",
                    "lang" : "painless"
                  }
                },
                "actions" : [
                  {
                    "id" : "8HRJQ4IBQXHTt9Y1O4QS",
                    "name" : "a6",
                    "destination_id" : "GXSOGoIBQXHTt9Y1rXgb",
                    "message_template" : {
                      "source" : "yes it is working",
                      "lang" : "mustache"
                    },
                    "throttle_enabled" : false,
                    "subject_template" : {
                      "source" : "Is this mail working",
                      "lang" : "mustache"
                    }
                  }
                ]
              }
            },
            {
              "query_level_trigger" : {
                "id" : "SnRcQ4IBQXHTt9Y1yYUt",
                "name" : "T5-2",
                "severity" : "1",
                "condition" : {
                  "script" : {
                    "source" : "return ctx.results[0].aggregations.metric.value == null ? false : ctx.results[0].aggregations.metric.value > 2",
                    "lang" : "painless"
                  }
                },
                "actions" : [
                  {
                    "id" : "S3RcQ4IBQXHTt9Y1yYUt",
                    "name" : "A6-2",
                    "destination_id" : "64clG4IB6fypFZiDArvx",
                    "message_template" : {
                      "source" : """Monitor {{ctx.monitor.name}} just entered alert status. Please investigate the issue.
  - Trigger: {{ctx.trigger.name}}
  - Severity: {{ctx.trigger.severity}}
  - Period start: {{ctx.periodStart}}
  - Period end: {{ctx.periodEnd}}""",
                      "lang" : "mustache"
                    },
                    "throttle_enabled" : true,
                    "subject_template" : {
                      "source" : "SLACK",
                      "lang" : "mustache"
                    },
                    "throttle" : {
                      "value" : 5,
                      "unit" : "MINUTES"
                    }
                  }
                ]
              }
            }
          ],
          "last_update_time" : 1658987530541
        }
      }
    ]
  }
}


@nateynate @ashisagr-amzn