Skip to main content
vendevu
Silver ⭐️⭐️
December 10, 2019
Solved

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

 

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-p/122948

 

http://mail-archives.apache.org/mod_mbox/ambari-user/201504.mbox/%3CA0F1A095-D4F9-47CE-BEC7-12C4EB54E5EC@hortonworks.com%3E

 

@nsabharwal- Could you please provide some ways to debug

 

 

 

jsensharma
Platinum ⭐️⭐️
December 12, 2019

@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

jsensharma
Platinum ⭐️⭐️
Platinum ⭐️⭐️
December 12, 2019

@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.

.

.

 

Translate
vendevu
vendevuAuthor
Silver ⭐️⭐️
December 12, 2019

@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.

Translate
vendevu
vendevuAuthor
Silver ⭐️⭐️
December 17, 2019

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!

Translate