Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. On the Ambari Server host, browse to /etc/ambari-server/conf directory.
  2. Edit the ambari.properties file.
  3. Add an entry for the location of your new template (that will override the default template). 

    Code Block
    alerts.template.file=/foo/var/alert-templates-custom.xml


  4. Save the file and restart Ambari Server.

...

Example: Modify Alert EMAIL Subject

 The following example illustrates how to change the subject line of all outbound email notifications to include a hard coded identifier:

 

 

  1. Download the alert-templates.xml code as your starting point.
  2. On the Ambari Server, save the template to a location such as /var/lib/ambari-server/resources/alert-templates-custom.xml .
  3. Edit the alert-templates-custom.xml file and modify the subject link for the <alert-template type="EMAIL"> template:
      
    Code Block
    <subject>
      <![CDATA[Petstore Ambari has $summary.getTotalCount() alerts!]]>
    </subject>

     

     
  4. Save the file.
  5. Browse to /etc/ambari-server/conf directory.
  6. Edit the ambari.properties file.
  7. Add an entry for the location of your new template file.
     

    Code Block
    alerts.template.file=/var/lib/ambari-server/resources/alert-templates-custom.xml


  8. Save the file and restart Ambari Server.