Watcher Could not connect to SMTP host

alerting

(Tsapaeva) #1

Hi All,

I have recently got free elastic cloud trial. I am trying to create simple watcher that would send an emails, but it is failing on email sending stage
I have whitelisted needed email addresses, but error seems to be not related to the addresses but to some conf problem

"actions": [
{
"id": "email_administrator",
"type": "email",
"status": "failure",
"error": {
"root_cause": [
{
"type": "messaging_exception",
"reason": "failed to send email with subject [Encountered logins] via account [work]"
}
],
"type": "messaging_exception",
"reason": "failed to send email with subject [Encountered logins] via account [work]",
"caused_by": {
"type": "messaging_exception",
"reason": "Could not connect to SMTP host: dockerhost, port: 10025, response: -1"
}
}
}
]
I can not find any solution to my problem in the forum
Thank you!


(Alexander Reelsen) #2

have you configured your own email account? You should not need to configure anything after the whitelisting is done. Just remove any account configuration and restart the cluster.

--Alex


(Tsapaeva) #3

I am on the cloud. It looks like it uses its own SMTP server. What do you mean by my own email account? What configuration should be made there? I do not have any email configuration except my normal email address here: https://cloud.elastic.co/#/account/email-settings/


(Alexander Reelsen) #4

can you try not setting any account in your watch when sending an email?


(Tsapaeva) #5

Thanks Alexander,

I have next watcher, can you please show what account should be removed or changed

`PUT _xpack/watcher/watch/test
{
"input": {
"search": {
"request": {
"indices": [
"smarp"
],
"body": {
"query": {
"match_all": {

        }
      }
    }
  }
}

},
"condition": {
"script": "for (def item : ctx.payload.hits.hits) {if (item.status == 'success') {return true;}}"

},
"trigger": {
"schedule": {
"interval": "30s"
}
},
"actions": {

"email_administrator": {
  "throttle_period": "15m",
  "email": {
    "to": "ekaterina.tsapaeva@smarp com",
    "subject": "Encountered {{ctx.payload.shards.total}} logins",
    "body": "",
    "attachments": {
      "attached_data": {
        "data": {
          "format": "json"
        }
      }
    },
    "priority": "high"
  }
}

}
}`


(Alexander Reelsen) #6

Hey,

I just reread that you are on cloud. so you can file a ticket through the cloud customer support for further help, they should be able to get you going!

--Alex


(system) #7

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