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.

Ambari Alert logs are not getting generated in /var/log/ambari-server

Solved Go to solution

Ambari Alert logs are not getting generated in /var/log/ambari-server

New Contributor

 

Hello Folks, 

 

I am trying to debug Ambari alerts , I am not getting logs generated in /var/log/ambari-server/ directory.

 

Ambari Version 2.5.1.0

 

HDP - 

1) Tried ambari-server restart 

2) enabled debug mode mentioned in 

 

tried steps mentioned in 

https://community.cloudera.com/t5/Support-Questions/Not-able-to-receive-emails-via-Ambari-Alerts/td-...

 

http://mail-archives.apache.org/mod_mbox/ambari-user/201504.mbox/%3CA0F1A095-D4F9-47CE-BEC7-12C4EB54...

 

@nsabharwal- Could you please provide some ways to debug

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: Ambari Alert logs are not getting generated in /var/log/ambari-server

Super Mentor

@vendevu 

Unfortunately the classes present inside the "org.apache.ambari.server.state.alert" package does not contain DEBUG messages hence you can not see those debugs.  But you can get the Alert Notification related DEBUGs.


As you have referred to other Community threads where you see the "Notification" related DEBUG messages like following:

DEBUG [alert-dispatch-5] EmailDispatcher:142 - Successfully dispatched email to [@.com], so it seems like Ambari is sending email but it is struck somewhere.

 

So if you want to see "Alert Notification" (like Email Notification/ SMTP notification) related DEBUGs inside your "ambari-server.log" then please try this:

Can you please try this:

1). Edit the "/etc/ambari-server/conf/log4j.properties" file and then Add the following line somewhere at the end of this file.

log4j.logger.org.apache.ambari.server.notifications=DEBUG


2). Restart Amabri Server

# ambari-server restart


3). Tail the ambari-server.log file.

# tail -f /var/log/ambari-server/ambari-server.log


4). As soon as some new alert notification (Like SMTP Alert Notification OR SNMP Alert Notification) will be triggered we should see some logging in the above log file.

.

.

 

3 REPLIES 3
Highlighted

Re: Ambari Alert logs are not getting generated in /var/log/ambari-server

Super Mentor

@vendevu 

Unfortunately the classes present inside the "org.apache.ambari.server.state.alert" package does not contain DEBUG messages hence you can not see those debugs.  But you can get the Alert Notification related DEBUGs.


As you have referred to other Community threads where you see the "Notification" related DEBUG messages like following:

DEBUG [alert-dispatch-5] EmailDispatcher:142 - Successfully dispatched email to [@.com], so it seems like Ambari is sending email but it is struck somewhere.

 

So if you want to see "Alert Notification" (like Email Notification/ SMTP notification) related DEBUGs inside your "ambari-server.log" then please try this:

Can you please try this:

1). Edit the "/etc/ambari-server/conf/log4j.properties" file and then Add the following line somewhere at the end of this file.

log4j.logger.org.apache.ambari.server.notifications=DEBUG


2). Restart Amabri Server

# ambari-server restart


3). Tail the ambari-server.log file.

# tail -f /var/log/ambari-server/ambari-server.log


4). As soon as some new alert notification (Like SMTP Alert Notification OR SNMP Alert Notification) will be triggered we should see some logging in the above log file.

.

.

 

Re: Ambari Alert logs are not getting generated in /var/log/ambari-server

New Contributor

@jsensharma  Thank you Sen Sharma. I have set the settings you mentioned in log4j.properties file.. will update shortly if I am able to see the ambari alert logs getting generated.

Re: Ambari Alert logs are not getting generated in /var/log/ambari-server

New Contributor

hi @jsensharma , Thank you very much. after following your steps of adding the debug in log4j properites file and restarting the ambari server . The alerts logs are now being generated. Really appreciate your input..

 

Thanks to the Community!!.. you guys rock!

Don't have an account?
Coming from Hortonworks? Activate your account here