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.

Alert template not displaying information

Solved Go to solution

Alert template not displaying information

Explorer

I am trying to modify the template of the alert notification. I see in the template code it tries to display ambari url but it never displays that. The lower end of the template reads like

<div class="ambari-footer">
    This notification was sent to $dispatch.getTargetName()
    <br/>
    Apache Ambari $ambari.getServerVersion()
    #if( $ambari.hasUrl() )
    <br/>
    Ambari Server link: <a href=$ambari.getUrl()>$ambari.getUrl()</a>
    #end
  </div>
</html>
      ]]>
    </body>

But I think method

ambari.hasUrl()

is always false. I tried printing the

$ambari.getUrl()

but it displays as it is. In the emails I see "$ambari.getUrl()". I checked the code

https://github.com/apache/ambari/blob/71a1f7e0e5985b1a77bf09b976ebda3ab3fdbbf5/ambari-server/src/mai...

@Inject
private Configuration m_configuration;

I am not sure from where it is getting injected from. Any suggestions why ambari url is not coming in the configs.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: Alert template not displaying information

Super Collaborator

It needs to take a static value from the /etc/ambari-server/conf/ambari.properties file. You need to add this and restart:

ambari.display.url = http://www.myserver.com

View solution in original post

3 REPLIES 3
Highlighted

Re: Alert template not displaying information

Super Collaborator

It needs to take a static value from the /etc/ambari-server/conf/ambari.properties file. You need to add this and restart:

ambari.display.url = http://www.myserver.com

View solution in original post

Highlighted

Re: Alert template not displaying information

Explorer

I added

ambari.display.url = http://100.123.123.123:8080 in properties file

but I still dont see ambari url in the email. I manually added

$ambari.getUrl() but it gets in the email as it is. Any other thing that I can do?

Highlighted

Re: Alert template not displaying information

Explorer

Got it. Tried it on a different cluster and this is working

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