I configured watcher configuration in elasticsearch.yml as follows
#Watcher Configuration
watcher.actions.email.service.account:
exchange_account:
profile: outlook
email_defaults:
from: abc@gmail.com
smtp:
auth: true
starttls.enable: true
host: abc.com
port: 587
user: xxx
password: xxx
My condition for watcher is as follows
{
"trigger" : {
"schedule" : { "interval" : "10s" }
},
"input" : {
"http" : {
"request" : {
"host" : "localhost",
"port" : 9200,
"path" : "/_cluster/health",
"auth" : {
"basic" : {
"username" : "123",
"password" : "123"
}
}
}
}
},
"condition" : {
"compare" : {
"ctx.payload.status" : { "eq" : "yellow" }
}
},
"actions" : {
"send_email" : {
"email" : {
"to" : "abc@xxx.com",
"subject" : "ES Cluster Status Warning",
"body" : "The Cluster is down."
}
}
}
}
Im getting few errors. So now i changed the host and port number according to my requirement.
Even after changing the host as xyz.com and port as 28 in elasticsearch.yml watcher condition is checking for the previous configuration.
"reason": "MessagingException[failed to send email with subject [ES Cluster Status Warning] via account [exchange_account]]; nested: MailConnectException[Couldn't connect to host, port: abc.com, 587; timeout 120000]; nested: ConnectException[Connection refused]; "
Help me.
thank you