Support Questions

Find answers, ask questions, and share your expertise

Configuring alert email without providing mail server user name & password

avatar
Explorer

Hi All,

I'm using Cloudera Express 6.3.0. I'm trying to configure alert emails to be received by a list of users. While configuring properties, it is asking for mail server user name & password. We have SMTP enabled and we are triggering emails with sendmail command on the nodes where Cloudera is installed. But, here why we need to provide the mail server user name & password for receiving the alert emails on our mail id. I have found a solution for this in Cloudera community (https://community.cloudera.com/t5/Support-Questions/Why-does-Alert-Publisher-require-mail-server-log...), but it is not working for my version of Cloudera. Does any know a turnaround for this.

Please refer to the link above for the solution provided & please also see the picture attached for better understanding.

 

When i click on Send Test Alert, i  see this pop up & the email is not triggeringWhen i click on Send Test Alert, i see this pop up & the email is not triggering

 

Mail Server UN & PWDMail Server UN & PWD

2 ACCEPTED SOLUTIONS

avatar
Super Collaborator

Thank you. That confirms alert email delivery fails because there is no SMTP daemon listening on localhost:25. 

 

I suspect there is a name resolution issue. Is the mail server hostname the host where CM is installed on, or a different host? Please login to CM, change the url in browser location bar to /cmf/debug/jmx and grep for MBeanServerId, does that show localhost or the correct hostname?

 

What do those commands show:

# getent hosts <mail server hostname>
# getent hosts <cm server hostname>
# getent hosts localhost

 

View solution in original post

avatar
Super Collaborator

Thanks @SuryaDilip 

 

Lets try for a test to set CM -> Administration -> Settings -> Category: Ports and Addresses to the actual FQDN of the CM host. This needs a restart of CM server. 

 

After that change, update Alert Publisher config and re-enter the mail server hostname again, and restart Alert Publisher. Do you see the same exception in the Alert Publisher logs then, for a test alert?

View solution in original post

7 REPLIES 7

avatar
Super Collaborator

Username/password is not strictly required for sending mails. This is not the cause for the issues you are seeing. Check the Alert Publisher logs for errors at the time when you hit the Send Test Alert button, there will be related errors shown why email delivery doesn't work yet.

avatar
Explorer

Hi @gzigldrum, thanks for replying. The below message is what i see in logs. As, per the below error "Couldn't connect to host, port: localhost, 25; timeout 30000;"  - As I highlighted in red color, why it is trying to connect to localhost? I provided the SMTP hostname:port no. in the "Alerts: Mail Server Hostname" config. I did not get any solid info from the log about why the error is occurring. Do you find anything from the below message? 

 

Stacktrace
---------------------------------------------------------------------------------------------------------------------------------------
com.sun.mail.util.MailConnectException: Couldn't connect to host, port: localhost, 25; timeout 30000;
nested exception is:
java.net.ConnectException: Connection refused (Connection refused)
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:2100)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:699)
at javax.mail.Service.connect(Service.java:366)
at org.apache.camel.component.mail.DefaultJavaMailSender.send(DefaultJavaMailSender.java:112)
at org.apache.camel.component.mail.MailProducer.process(MailProducer.java:63)
at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
at org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:173)
at org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:436)
at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:168)
at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:541)
at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:198)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:120)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:83)
at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:198)
at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:198)
at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:109)
at org.apache.camel.processor.MulticastProcessor.doProcessParallel(MulticastProcessor.java:841)
at org.apache.camel.processor.MulticastProcessor.access$200(MulticastProcessor.java:85)
at org.apache.camel.processor.MulticastProcessor$1.call(MulticastProcessor.java:328)
at org.apache.camel.processor.MulticastProcessor$1.call(MulticastProcessor.java:314)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.net.ConnectException: Connection refused (Connection refused)
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:606)
at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:329)
at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:238)
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:2066)

avatar
Super Collaborator

Thank you. That confirms alert email delivery fails because there is no SMTP daemon listening on localhost:25. 

 

I suspect there is a name resolution issue. Is the mail server hostname the host where CM is installed on, or a different host? Please login to CM, change the url in browser location bar to /cmf/debug/jmx and grep for MBeanServerId, does that show localhost or the correct hostname?

 

What do those commands show:

# getent hosts <mail server hostname>
# getent hosts <cm server hostname>
# getent hosts localhost

 

avatar
Explorer

Hi @gzigldrum, Please find the answers below:

 

Please help.

 

Q1) Is the mail server hostname the host where CM is installed on, or a different host?

   A) It is a different host.

 

Q2) Please login to CM, change the url in browser location bar to /cmf/debug/jmx and grep for MBeanServerId, does that show localhost or the correct hostname?

   A) It is showing localhost_somenumber (ZMLPZCNVSAPP03_1600837272908)

 

Q3) What do those commands show:

   A) # getent hosts <mail server hostname> - Displays my mail server IP and Host Name
        # getent hosts <cm server hostname> - Displays CM IP & Host Name
        # getent hosts localhost - displays below info in the screenshotCapture.JPG

avatar
Super Collaborator

Thanks @SuryaDilip 

 

Lets try for a test to set CM -> Administration -> Settings -> Category: Ports and Addresses to the actual FQDN of the CM host. This needs a restart of CM server. 

 

After that change, update Alert Publisher config and re-enter the mail server hostname again, and restart Alert Publisher. Do you see the same exception in the Alert Publisher logs then, for a test alert?

avatar
Explorer

Hi @gzigldrum ,

 

Thank U very very much for the help. I'm able to receive the email alerts. The solution you provided in the last answer really really helped me.

avatar
Super Collaborator

Great to hear @SuryaDilip !

Although I noticed my last update was not complete, I referenced the CM -> Administration -> Settings -> Category: Ports and Addresses -> Cloudera Manager Hostname Override configuration property.