I've been digging through the forum and the X-Pack Documentation but can't seem to find the right configuration for Watcher to send email through an SMTP connection. The Watch is executing correctly, but it cannot seem to find my configured SMTP email account in the elasticsearch.yml file:
Watch Configuration:
"actions": {
"log": {
"logging": {
"level": "info",
"text": "{{ctx.payload.hits.total}} 4634 events have occured in the logs:{{#ctx.payload.hits.hits}}{{_id}}:{{/ctx.payload.hits.hits}}"
}
},
"send_email": {
"email": {
"profile": "standard",
"to": [
"ccampbell@convexitycapital.com"
],
"subject": "Test Watch Notification",
"body": {
"text": "{{ctx.payload.hits.total}} 4634 events have occured in the logs:{{#ctx.payload.hits.hits}}{{_id}}:{{/ctx.payload.hits.hits}}"
}
}
}
},
Elasticsearch is running on a Windows 2012 server, the SMTP server is an Exchange server, with no authentication requirements. The error in the Watch execution output is:
{
"id": "send_email",
"type": "email",
"status": "failure",
"reason": "IllegalArgumentException[no account found for name: [null]]"
}
What am I missing? I've tried adding a line '"account": "smtp_account",' into the Watch, but then I get the error '"IllegalArgumentException[no account found for name: [smtp_account]]"'
It seems like your mail server didn't recognize the user you were using. Though no authentication is required to connect to your server, it might no accept to send mail from "dummy" / "unknown" users.
Do you observe the same behavior with an existing user on this server ?
I've only made the changes to one of the Elasticsearch nodes (WINES5-INFR) - that's the same node that I'm working in Kibana on and doing the Watch configuration on. Do I need to restart all 3 nodes ES instances?
That actually is a user on the server - or at least it's a dummy user used by other services in our environment - a valid user name has never been a problem in previous SMTP configuration on our Exchange setup.
yes, that configuration has to be applied on all nodes. Watcher runs on the master node, so this is where the configuration has to exist.
You could have used the cluster update settings API to configure those settings dynamically, but then you have to make sure those settings are persistent, and they require some more time to look them up instead of just peeking into the configuration file.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.