Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here. Want to know more about what has changed? Check out the Community News blog.

ambari email notification issue

Highlighted

ambari email notification issue

New Contributor

We are using HDP2.5 cluster. We have configured email alerts from Ambari UI .

As We observed, We are getting email notifications only after restarting ambari server .

i mean , We are not getting alerts at the time of service down and start . We ar egetting all pening alerts at a time after restarting ambari-server.

requesting you to help on this . thanks

6 REPLIES 6

Re: ambari email notification issue

Super Mentor

@srini

When a notification is encountered that time you should see a notification triggering message in your log (specially the ambari-alerts.log). So please check the time stamp of that notification and then check the time when you received the mail. If you find that the notification was triggered long back (according to the log) but you are still receiving the mails late, then it means your SMTP server settings need to be tested. In such case try writing a simple SMTP client code or "mailx" (linux utility) to check whether there is a delay from your Mail server?

- Regarding your query "We are not getting alerts at the time of service down and start". It might be related to the type of notification that you have set. Can you please share your Mail Notification configs/screenshot so that we can check if it is configured fine or not. Like the severity should be set properly and the groups need to be chosen carefully.

For example you can refer to:

https://community.hortonworks.com/articles/40361/how-to-troubleshoot-ambari-alerts-notification.html

Re: ambari email notification issue

Super Mentor

@srini

For further troubleshooting you might want to enable the DEBUG logging for alerts so that we will know what else might be causing the delay.

In order to enable the DEBUG logging for alert dispatching, You can edit the file "/etc/ambari-server/conf/log4j.properties" and then Modify:

log4j.logger.alerts=INFO,alerts 
-------> TO following:
log4j.logger.alerts=DEBUG,alerts

Or for specific package logging, you can add the below line to the same file:

log4j.logger.org.apache.ambari.server.notifications.dispatchers=DEBUG,alert

.

Re: ambari email notification issue

New Contributor

That should be DEBUG,alerts. There is no logger named alert.

Re: ambari email notification issue

Super Mentor

@Michael Salmon

Good catch. That was a typo. Thanks for correcting.

log4j.logger.org.apache.ambari.server.notifications.dispatchers=DEBUG,alerts

Re: ambari email notification issue

Super Collaborator

Older versions of Ambari did have problems sending out emails (see https://issues.apache.org/jira/browse/AMBARI-9823) but since you're using HDP 2.5, I'm assuming you're on a newer version.

- Can you provide the version of Ambari?

- Can you upload your ambari-server.log

Re: ambari email notification issue

New Contributor

Hi All,

I'm having trouble setting Email alerts in Ambari. I have setup a local postfix in ambari server host and i'm able to send test email using the 'mail' command. But Ambari is unable to send alerts using the postfix setup. Can anyone help me troubleshoot the issue or provide the steps to configure the same?

Attached the configuration screenshot.

alert-config-screen.png

Error log:

28 Nov 2017 13:27:31,664 INFO [alert-dispatch-1] EmailDispatcher:94 - Sending email: Notification{ type=ALERT, subject=Alert Summary: OK[0], Warning[0], Critical[1], Unknown[0]}

28 Nov 2017 13:27:32,742 ERROR [alert-dispatch-1] EmailDispatcher:172 - Unable to dispatch notification via Email javax.mail.MessagingException: Could not connect to SMTP host: 10.x.xx.xx, port: 587, response: -1 at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:2041) at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:697) at javax.mail.Service.connect(Service.java:364) at javax.mail.Service.connect(Service.java:245) at javax.mail.Service.connect(Service.java:194) at javax.mail.Transport.send0(Transport.java:253) at javax.mail.Transport.send(Transport.java:124) at org.apache.ambari.server.notifications.dispatchers.EmailDispatcher.dispatch(EmailDispatcher.java:160) at org.apache.ambari.server.notifications.DispatchRunnable.run(DispatchRunnable.java:58) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:748)