<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Modifying the email subject in ambari alert in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Modifying-the-email-subject-in-ambari-alert/m-p/243460#M205258</link>
    <description>&lt;P&gt;Hi &lt;A rel="user" href="https://community.cloudera.com/users/11304/kumarveerappan.html" nodeid="11304"&gt;@Kumar Veerappan&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;I guess you are referring to this blog for Customizing the Ambari Alert : &lt;A href="https://cwiki.apache.org/confluence/display/AMBARI/Customizing+the+Alert+Template" target="_blank"&gt;https://cwiki.apache.org/confluence/display/AMBARI/Customizing+the+Alert+Template&lt;/A&gt;&lt;/P&gt;&lt;P&gt;then you can change the alert to Your desired one with help of editing the &amp;lt;subject&amp;gt;&amp;lt;/subject&amp;gt; in alert-templates.xml : &lt;A href="https://github.com/apache/ambari/blob/trunk/ambari-server/src/main/resources/alert-templates.xml#L21" target="_blank"&gt;https://github.com/apache/ambari/blob/trunk/ambari-server/src/main/resources/alert-templates.xml#L21&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Just for example, I have some changes on subject for my Business logic : &lt;/P&gt;&lt;PRE&gt; &amp;lt;subject&amp;gt;
      &amp;lt;![CDATA[
     #set( $criticalServices = $summary.getServicesByAlertState("CRITICAL"))
     #if( $summary.getCriticalCount() ==0)
       There is no new critical Alert!
     #{else}
      We have $summary.getCriticalCount() Critical Alert(s).Alert Details : ,#foreach( $service in $criticalServices ) #foreach( $alert in $summary.getAlerts($service,"CRITICAL") ) Service Name : $alert.getServiceName(),Host Name : $alert.getHostName()
       #end
      #end
     #end 
       ]]&amp;gt;
    &amp;lt;/subject&amp;gt;&lt;/PRE&gt;&lt;P&gt;Which is doing nothing but Listing critical alert count in the Email subject.&lt;/P&gt;&lt;P&gt;See if you can Makeuse of some thing out of it.&lt;/P&gt;&lt;P&gt;Please give a Accept answer if it did.&lt;/P&gt;</description>
    <pubDate>Tue, 29 Jan 2019 11:11:19 GMT</pubDate>
    <dc:creator>akhilsnaik</dc:creator>
    <dc:date>2019-01-29T11:11:19Z</dc:date>
    <item>
      <title>Modifying the email subject in ambari alert</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Modifying-the-email-subject-in-ambari-alert/m-p/243459#M205257</link>
      <description>&lt;P&gt;I have requirement to modify the email subject from Ambari for certain alerts. For example, anything related to HDFS, I need to have "CRITICAL HDFS" in the subject line. I went through this link : &lt;A href="https://community.hortonworks.com/questions/198815/ambari-email-alert-format.html" target="_blank"&gt;https://community.hortonworks.com/questions/198815/ambari-email-alert-format.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;but it does not talk about customizing the subject for certain alerts.&lt;/P&gt;&lt;P&gt;Has anyone has this setup in your environment ?&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jan 2019 23:03:23 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Modifying-the-email-subject-in-ambari-alert/m-p/243459#M205257</guid>
      <dc:creator>kums</dc:creator>
      <dc:date>2019-01-25T23:03:23Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying the email subject in ambari alert</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Modifying-the-email-subject-in-ambari-alert/m-p/243460#M205258</link>
      <description>&lt;P&gt;Hi &lt;A rel="user" href="https://community.cloudera.com/users/11304/kumarveerappan.html" nodeid="11304"&gt;@Kumar Veerappan&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;I guess you are referring to this blog for Customizing the Ambari Alert : &lt;A href="https://cwiki.apache.org/confluence/display/AMBARI/Customizing+the+Alert+Template" target="_blank"&gt;https://cwiki.apache.org/confluence/display/AMBARI/Customizing+the+Alert+Template&lt;/A&gt;&lt;/P&gt;&lt;P&gt;then you can change the alert to Your desired one with help of editing the &amp;lt;subject&amp;gt;&amp;lt;/subject&amp;gt; in alert-templates.xml : &lt;A href="https://github.com/apache/ambari/blob/trunk/ambari-server/src/main/resources/alert-templates.xml#L21" target="_blank"&gt;https://github.com/apache/ambari/blob/trunk/ambari-server/src/main/resources/alert-templates.xml#L21&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Just for example, I have some changes on subject for my Business logic : &lt;/P&gt;&lt;PRE&gt; &amp;lt;subject&amp;gt;
      &amp;lt;![CDATA[
     #set( $criticalServices = $summary.getServicesByAlertState("CRITICAL"))
     #if( $summary.getCriticalCount() ==0)
       There is no new critical Alert!
     #{else}
      We have $summary.getCriticalCount() Critical Alert(s).Alert Details : ,#foreach( $service in $criticalServices ) #foreach( $alert in $summary.getAlerts($service,"CRITICAL") ) Service Name : $alert.getServiceName(),Host Name : $alert.getHostName()
       #end
      #end
     #end 
       ]]&amp;gt;
    &amp;lt;/subject&amp;gt;&lt;/PRE&gt;&lt;P&gt;Which is doing nothing but Listing critical alert count in the Email subject.&lt;/P&gt;&lt;P&gt;See if you can Makeuse of some thing out of it.&lt;/P&gt;&lt;P&gt;Please give a Accept answer if it did.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jan 2019 11:11:19 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Modifying-the-email-subject-in-ambari-alert/m-p/243460#M205258</guid>
      <dc:creator>akhilsnaik</dc:creator>
      <dc:date>2019-01-29T11:11:19Z</dc:date>
    </item>
  </channel>
</rss>

