Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Support Questions

Find answers, ask questions, and share your expertise
Announcements
Share your experience with Cloudera on G2 and get a $25 Amazon Gift card.
Hi, I'm CLEO! Something exciting is coming to the Community. Stay Tuned!

How to put the alert name into the subject of an Ambari Alert

avatar
New Member

Hi,

I want to put the alert name in the subject of the email alert

 

I followed the example in https://github.com/apache/ambari/blob/branch-2.1/ambari-server/src/main/resources/alert-templates.xm... but the following does not fill in the  variables and I just the the variable names in the email.

<![CDATA[Ambari: [$alert.getAlertState()]-[$alert.getAlertName()]-[$alert.getAlertText()]]]>

If I use the template as it is, the email populates with the summary variables, ie:

<![CDATA[Alert Summary: OK[$summary.getOkCount()], Warning[$summary.getWarningCount()], Critical[$summary.getCriticalCount()], Unknown[$summary.getUnknownCount()]]]>

Is there a trick to get the subject to show the $alert variables to the subject?

Thanks in advance!

 

Eric

 

1 ACCEPTED SOLUTION

avatar
Master Collaborator

1. On the Abari server host, locate the `alert-templates.xml` file. By default, it is located in the `/etc/ambari-server/conf` directory.
2. Open the `alert-templates.xml` file and search for the `` section.
3. Within the `` section, locate the `` tag and modify its content.

4. Save the changes to the `alert-templates.xml` file.
5. Restart Ambari server for the changes to take effec

View solution in original post

1 REPLY 1

avatar
Master Collaborator

1. On the Abari server host, locate the `alert-templates.xml` file. By default, it is located in the `/etc/ambari-server/conf` directory.
2. Open the `alert-templates.xml` file and search for the `` section.
3. Within the `` section, locate the `` tag and modify its content.

4. Save the changes to the `alert-templates.xml` file.
5. Restart Ambari server for the changes to take effec